From 634a93ac6541aa0fc0e530fd52ff0ecadc1905b2 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 16 Jun 2020 13:00:10 -0400 Subject: [PATCH] 1.54.3 --- dist/README.md | 42 ++++++++++++++++++------------------ dist/plotly-basic.js | 17 +++++++++++---- dist/plotly-basic.min.js | 4 ++-- dist/plotly-cartesian.js | 17 +++++++++++---- dist/plotly-cartesian.min.js | 4 ++-- dist/plotly-finance.js | 17 +++++++++++---- dist/plotly-finance.min.js | 4 ++-- dist/plotly-geo-assets.js | 4 ++-- dist/plotly-geo.js | 17 +++++++++++---- dist/plotly-geo.min.js | 4 ++-- dist/plotly-gl2d.js | 17 +++++++++++---- dist/plotly-gl2d.min.js | 4 ++-- dist/plotly-gl3d.js | 17 +++++++++++---- dist/plotly-gl3d.min.js | 4 ++-- dist/plotly-mapbox.js | 17 +++++++++++---- dist/plotly-mapbox.min.js | 4 ++-- dist/plotly-with-meta.js | 17 +++++++++++---- dist/plotly.js | 17 +++++++++++---- dist/plotly.min.js | 4 ++-- package-lock.json | 2 +- package.json | 2 +- src/version.js | 2 +- 22 files changed, 159 insertions(+), 78 deletions(-) diff --git a/dist/README.md b/dist/README.md index 8226e0c9276..b22172da293 100644 --- a/dist/README.md +++ b/dist/README.md @@ -51,7 +51,7 @@ object. This property must be set before the plotly.js script tag, for example: Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle. Many other localizations are available - here is an example using Swiss-German (de-CH), see the contents of this directory for the full list. -They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.54.2.js +They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.54.3.js Note that the file names are all lowercase, even though the region is uppercase when you apply a locale. *After* the plotly.js script tag, add: @@ -74,12 +74,12 @@ The main plotly.js bundle includes all the official (non-beta) trace modules. It be can imported as minified javascript - using dist file `dist/plotly.min.js` -- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.54.2.min.js +- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.54.3.min.js or as raw javascript: - using the `plotly.js-dist` npm package (starting in `v1.39.0`) - using dist file `dist/plotly.js` -- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.54.2.js +- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.54.3.js - using CommonJS with `require('plotly.js')` If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), use dist file `dist/plotly-with-meta.js` @@ -88,7 +88,7 @@ The main plotly.js bundle weights in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| -| 7 MB | 3.3 MB | 988.1 kB | 7.3 MB | +| 7 MB | 3.3 MB | 988.2 kB | 7.3 MB | ## Partial bundles @@ -122,8 +122,8 @@ The `basic` partial bundle contains trace modules `scatter`, `bar` and `pie`. | ------ | --- | | Latest | https://cdn.plot.ly/plotly-basic-latest.js | | Latest minified | https://cdn.plot.ly/plotly-basic-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-basic-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-basic-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-basic-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-basic-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -175,8 +175,8 @@ The `cartesian` partial bundle contains trace modules `scatter`, `bar`, `box`, ` | ------ | --- | | Latest | https://cdn.plot.ly/plotly-cartesian-latest.js | | Latest minified | https://cdn.plot.ly/plotly-cartesian-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-cartesian-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-cartesian-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -220,7 +220,7 @@ The `geo` partial bundle contains trace modules `scatter`, `scattergeo` and `cho | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 2.5 MB | 916 kB | 302.4 kB | +| 2.5 MB | 916.1 kB | 302.4 kB | #### CDN links @@ -228,8 +228,8 @@ The `geo` partial bundle contains trace modules `scatter`, `scattergeo` and `cho | ------ | --- | | Latest | https://cdn.plot.ly/plotly-geo-latest.js | | Latest minified | https://cdn.plot.ly/plotly-geo-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-geo-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-geo-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-geo-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-geo-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -273,7 +273,7 @@ The `gl3d` partial bundle contains trace modules `scatter`, `scatter3d`, `surfac | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3.6 MB | 1.4 MB | 451.8 kB | +| 3.6 MB | 1.4 MB | 451.9 kB | #### CDN links @@ -281,8 +281,8 @@ The `gl3d` partial bundle contains trace modules `scatter`, `scatter3d`, `surfac | ------ | --- | | Latest | https://cdn.plot.ly/plotly-gl3d-latest.js | | Latest minified | https://cdn.plot.ly/plotly-gl3d-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-gl3d-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-gl3d-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -326,7 +326,7 @@ The `gl2d` partial bundle contains trace modules `scatter`, `scattergl`, `splom` | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3.6 MB | 1.4 MB | 472.9 kB | +| 3.6 MB | 1.4 MB | 473 kB | #### CDN links @@ -334,8 +334,8 @@ The `gl2d` partial bundle contains trace modules `scatter`, `scattergl`, `splom` | ------ | --- | | Latest | https://cdn.plot.ly/plotly-gl2d-latest.js | | Latest minified | https://cdn.plot.ly/plotly-gl2d-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-gl2d-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-gl2d-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -387,8 +387,8 @@ The `mapbox` partial bundle contains trace modules `scatter`, `scattermapbox`, ` | ------ | --- | | Latest | https://cdn.plot.ly/plotly-mapbox-latest.js | | Latest minified | https://cdn.plot.ly/plotly-mapbox-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-mapbox-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-mapbox-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.54.3.min.js | #### npm package (starting in `v1.39.0`) @@ -440,8 +440,8 @@ The `finance` partial bundle contains trace modules `scatter`, `bar`, `histogram | ------ | --- | | Latest | https://cdn.plot.ly/plotly-finance-latest.js | | Latest minified | https://cdn.plot.ly/plotly-finance-latest.min.js | -| Tagged | https://cdn.plot.ly/plotly-finance-1.54.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-finance-1.54.2.min.js | +| Tagged | https://cdn.plot.ly/plotly-finance-1.54.3.js | +| Tagged minified | https://cdn.plot.ly/plotly-finance-1.54.3.min.js | #### npm package (starting in `v1.39.0`) diff --git a/dist/plotly-basic.js b/dist/plotly-basic.js index 92591723f78..7b1542d74e0 100644 --- a/dist/plotly-basic.js +++ b/dist/plotly-basic.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic) v1.54.2 +* plotly.js (basic) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -65238,6 +65238,15 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { )(layoutIn, layoutOut, coerce); }; +function getComputedSize(attr) { + return ( + (typeof attr === 'string') && + (attr.substr(attr.length - 2) === 'px') && + parseFloat(attr) + ); +} + + plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { var context = gd._context || {}; var frameMargins = context.frameMargins; @@ -65264,8 +65273,8 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { // but don't enforce any ratio restrictions var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {}; - newWidth = parseFloat(computedStyle.width) || parseFloat(computedStyle.maxWidth) || fullLayout.width; - newHeight = parseFloat(computedStyle.height) || parseFloat(computedStyle.maxHeight) || fullLayout.height; + newWidth = getComputedSize(computedStyle.width) || getComputedSize(computedStyle.maxWidth) || fullLayout.width; + newHeight = getComputedSize(computedStyle.height) || getComputedSize(computedStyle.maxHeight) || fullLayout.height; if(isNumeric(frameMargins) && frameMargins > 0) { var factor = 1 - 2 * frameMargins; @@ -78313,7 +78322,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[4])(4) }); diff --git a/dist/plotly-basic.min.js b/dist/plotly-basic.min.js index 46aba325701..9ac8ae8db11 100644 --- a/dist/plotly-basic.min.js +++ b/dist/plotly-basic.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic - minified) v1.54.2 +* plotly.js (basic - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -18,4 +18,4 @@ * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":18,"./lib/epsilon":19,"./lib/geojson":20,"./lib/intersecter":21,"./lib/segment-chainer":23,"./lib/segment-selector":24}],18:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],19:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],20:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(R(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],27:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],28:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218,"../../plots/font_attributes":240,"./arrow_paths":27}],29:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":168,"../../plots/cartesian/axes":212,"./draw":34}],30:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(U=!0):U=!0),X=te._offset+te.r2p(t[$]),Q=.5}else"x"===$?(W=t[$],X=b.l+b.w*W):(W=1-t[$],X=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=X;var ue=t["a"+$];J=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),Y=J):(se.tail=X+ue,Y=J+ue),se.text=se.tail+J;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else Y=J=ie*j(Q,oe),se.text=X+J;se.text+=le,J+=le,Y+=le,t["_"+$+"padplus"]=ie/2+Y,t["_"+$+"padminus"]=ie/2-Y,t["_"+$+"size"]=ie,t["_"+$+"shift"]=J}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,E/2,E/2,R-E,H-E),z.call(c.setTranslate,Math.round(L.x.text-R/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),E=m-.5*P,R=E+P,I=y-.5*D,N=I+D,B=[[E,I,E,N],[E,N,R,N],[R,N,R,I],[R,I,E,I]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/X,Z+=t.standoff*(h-f)/X}var Y,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);Y=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),T("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&T("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&T("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),P)p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?T("ax",l.p2r(l.r2p(t.ax)+e)):T("ax",t.ax+e),t.ayref===t.yref?T("ay",v.p2r(v.r2p(t.ay)+r)):T("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var k=y*Math.cos(s),T=y*Math.sin(s);o.x-=k,o.y-=T,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":243,"../annotations/draw":34}],41:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));Z*=W*c.roundUp(Y/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+I-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,J=e.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+T.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+I-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+T.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(P);m.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=H+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),k=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:$,path:l.makeTickPath(G,b,C),transFn:k}),l.drawLabels(r,G,{vals:w,layer:$,transFn:k,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((Q=J.select("text")).node()&&!Q.classed(T.jsPlaceholder)){var a,o=J.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(J.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+T.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+T.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/extend":163,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../plots/cartesian/axis_defaults":214,"../../plots/cartesian/layout_attributes":226,"../../plots/cartesian/position_defaults":229,"../../plots/plots":246,"../../registry":254,"../color":43,"../colorscale/helpers":54,"../dragelement":62,"../drawing":65,"../titles":138,"./constants":45,d3:7,tinycolor2:26}],48:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":168}],49:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":44,"./defaults":46,"./draw":47,"./has_colorbar":48}],50:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":183,"../colorbar/attributes":44,"./scales.js":58}],51:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":168,"./helpers":54,"fast-isnumeric":9}],52:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],60:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":168}],61:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],62:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":168,"../../plots/cartesian/constants":218,"./align":59,"./cursor":60,"./unhover":63,"has-hover":11,"has-passive-events":12,"mouse-event-offset":15}],63:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":161,"../../lib/events":162,"../../lib/throttle":190,"../fx/constants":77}],64:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],65:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=T[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=v),P++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var R=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(R);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":79,"../../constants/alignment":145,"../../constants/interactions":147,"../../constants/xmlns_namespaces":149,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":254,"../../traces/scatter/make_bubble_size_func":311,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale":55,"./symbol_defs":66,d3:7,"fast-isnumeric":9,tinycolor2:26}],66:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:7}],67:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],68:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":318,"../drawing":65,d3:7,"fast-isnumeric":9}],73:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":43,d3:7}],74:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":163,"../../plots/font_attributes":240,"./layout_attributes":84}],75:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),R="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(R[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==Y&&0===W.length){G.distance=Y,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=Y}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>p.spikeDistance)&&(J.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>p.spikeDistance)&&(J.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:Te,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Le,Te?"xa":"ya",u),O(Le,Te));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:R})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,E=D.width,R=D.height,I=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-T)+",0L"+S+","+A+T+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"H"+(S-2*T)+"Z")):l.attr("d","M0,0L"+T+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+T+"H-"+T+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=k._offset+k._length):(C="end",P=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+T+","+T+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+T+"V-"+T+"Z");var E,R=x.height/2,I=z-x.top-R,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=$+ne>=R;return ne<=R&&($<=z?$=L._offset+2*M:ae&&($=R-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=D.width+T+M+k;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=F,S=N+H/2+j<=R,P=N-H/2-j>=0,"top"!==e.idealAlign&&S||!P?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,P=F-B/2-j>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(T+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*T+d)+","+(T+p)+"v"+(e.by/2-T)+"h"+o*e.bx+"v-"+e.by+"H"+(o*T+d)+"V"+(p-T)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:T,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?k:-k),cy:m,r:k,fill:T}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,R=n.spikethickness,I=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=F,D=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),P=s.t+(1-B)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":R,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":R+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?R:-R),r:R,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":168,"../../lib/events":162,"../../lib/override_cursor":179,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"../legend/defaults":95,"../legend/draw":96,"./constants":77,"./helpers":79,d3:7,"fast-isnumeric":9,tinycolor2:26}],81:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":168,"../color":43,"./helpers":79}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===T("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/layout_attributes":244,"../../registry":254,"./attributes":93,"./helpers":99}],96:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),k=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var E=z.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(k?M&&"left"===w?o.l+o.w:S:T?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var P=0;if(s){var D=0,z=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,E+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,E),z+=r})),a._width=Math.max(P,z)+u,a._height=E+D+g}else{var R=r.size(),I=O+f+(R-1)*ha._maxWidth&&(P=Math.max(P,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),I?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,T=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=T;w=a.constrain(w,0,l.width-t._width),T=a.constrain(T,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,T),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,E,R,I=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-I-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,I,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),I,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(R,z,E),I,B))}));D.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,R=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(R,z,E),I,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/events":162,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"./constants":94,"./get_legend_data":97,"./handle_click":98,"./helpers":99,"./style":101,d3:7}],97:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),k=f||m,T=p||v,M=w||!k?"M5,0":T?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":168,"../../registry":254,"../../traces/pie/helpers":286,"../../traces/pie/style_one":292,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale/helpers":54,"../drawing":65,d3:7}],102:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=I[r+1];else if(e=n.pmax)t=I[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(T=f,S="y0",M=y,C="y1"):(T=y,S="y1",M=f,C="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?Y:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),J(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;J(l)}};function X(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),R?N("yanchor",r.yanchor=U(k+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=R?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=R?d:U(d))}else if("resize-over-end-point"===z){var p=v+n,h=R?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=R?h:U(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),X=m("e"),Y=b?T+a:T,W=G?M+a:M,J=Z?A+n:A,$=X?L+n:L;R&&(b&&(Y=T-a),G&&(W=M-a)),(!R&&W-Y>10||R&&Y-W>10)&&(N(S,r[S]=R?Y:U(Y)),N(C,r[C]=R?W:U(W))),$-J>10&&(N(O,r[O]=E?J:q(J)),N(P,r[P]=E?$:q($)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||R)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(R?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&R){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function J(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=X}(e,E,s,t,r,z):!0===s.editable&&E.style("pointer-events",P||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),k=Math.abs(_-u),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(T=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(T,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(R),D&&(L?E.on(".opacity",null):(T=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":145,"../../constants/interactions":147,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../drawing":65,d3:7,"fast-isnumeric":9}],139:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":163,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/font_attributes":240,"../../plots/pad_attributes":245,"../color/attributes":42}],140:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":139,"./constants":140}],142:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>k,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,E=v;z+P>s&&(z=s-P);var R=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=R.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:E,width:P,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+P+.5:f+.5,B=d-.5,H=T?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":43,"../drawing":65,d3:7}],145:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],146:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],147:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],148:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],149:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],150:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],153:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],154:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":175}],155:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(T,P.toMonthIndex(T,M,D),A)}else O=P.newDate(T,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(T),z.getUTCMonth()!==M||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,T=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":175}],167:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],168:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function T(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":148,"./anchor_utils":153,"./angles":154,"./array":155,"./clean_number":156,"./clear_responsive":158,"./coerce":159,"./dates":160,"./dom":161,"./extend":163,"./filter_unique":164,"./filter_visible":165,"./geometry2d":166,"./identity":167,"./is_plain_object":169,"./keyed_container":170,"./localize":171,"./loggers":172,"./make_trace_groups":173,"./matrix":174,"./mod":175,"./nested_property":176,"./noop":177,"./notifier":178,"./push_unique":181,"./regex":183,"./relative_attr":184,"./relink_private":185,"./search":186,"./stats":188,"./throttle":190,"./to_log_range":191,d3:7,"fast-isnumeric":9}],169:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],170:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":200,"./notifier":178}],173:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:7}],174:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],176:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":148,"./matrix":174}],181:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":155,"fast-isnumeric":9}],189:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],191:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":9}],192:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],193:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],194:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===D)E=L;else{for(z=Math.max(C.length,z),E=[],x=0;x=D);x++)E.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),i.colorbars&&l.push(T.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[R];)R--;var I=z.parts[R],F=z.parts[R-1]+"."+I,H=z.parts.slice(0,R).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=z.get();if(void 0!==E){T[D]=E,L[D]="reverse"===I?E:N(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var J="height"===D?"width":"height";S(J,s[J])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))P(F),l(s,H+"._inputRange").set(null);else if(F.match(X)){P(F),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Y)&&l(s,H+"._inputDomain").set(null);if("type"===I){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[D]}else"reverse"===I?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&TT)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":209}],203:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var T=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?k(u,T,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(y(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,R,I,F,N,B,H,j,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(M);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":168,"../plots/attributes":209,"../plots/plots":246,"./plot_config":200,"./plot_schema":201,"./plot_template":202}],205:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(T);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(T,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":168,"../plots/plots":246,"../snapshot/helpers":258,"../snapshot/svgtoimg":260,"../snapshot/tosvg":262,"../version":321,"./plot_api":199,"fast-isnumeric":9}],206:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(T);if(P&&(O=Math.min(O,T.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,T[A].length):D);M++)L=P?T[A][M]:T,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(k)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=T?[Math.max(0,C),Math.max(1,O)]:[C,O]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":148,"../../lib":168,"../../registry":254,"fast-isnumeric":9}],212:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),T=k.MID_SHIFT,M=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(X(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,I)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,I))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,I)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,I));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||X(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function X(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":X(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||Y&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*T},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||k)for(r=0;rz&&IP&&(P=I);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:P,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){Te="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(Te="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){Te="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":168,"fast-isnumeric":9}],230:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":145}],231:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,T=e("./constants"),M=T.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,P=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!H){var r=Y.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,X,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&X.emit("plotly_selected",void 0);l.click(X,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":43,"../../components/dragelement/helpers":61,"../../components/drawing":65,"../../components/fx":83,"../../components/fx/helpers":79,"../../components/shapes/draw_newshape/display_outlines":128,"../../components/shapes/draw_newshape/helpers":129,"../../components/shapes/draw_newshape/newshapes":130,"../../lib":168,"../../lib/clear_gl_canvases":157,"../../lib/polygon":180,"../../lib/throttle":190,"../../plot_api/subroutines":203,"../../registry":254,"./axis_ids":215,"./constants":218,"./handle_outline":222,"./helpers":223,polybooljs:17}],232:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function T(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(T(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var E=function(t){return a(t)?D(t,e._m,e._b):p},R=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},R=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?k:c,e.l2p=E,e.p2l=R,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return k(R(e))}:R,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=R,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(R(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=R,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(R(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,T=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":65,"../../lib":168,"../../registry":254,"./axes":212,d3:7}],237:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),L(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,S=h[M].r.size;if(A>_){var C=(w*A+(S-d)*_)/(A-_),O=(S*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(T)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>k){var z=(T*P+(D-p)*k)/(P-k),E=(D*(1-k)+(T-p)*(1-P))/(P-k);z>=0&&E>=0&&p-(E+z)>0&&z+E>f+u&&(f=z,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var R=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(P(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);M&&!T&&(S=0);var C=L.slice();A&&T&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(E)}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 R,I=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:R,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),R.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+X(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=X(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));R.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!T){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};T&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":145,"../../../lib":168,d3:7}],251:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":43,"../../../lib":168,"./micropolar":250,"./undo_manager":252,d3:7}],252:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":43,"../components/drawing":65,"../constants/xmlns_namespaces":149,"../lib":168,d3:7}],263:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(k=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},T=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var P=g[e.index],D=v.base?P.b+P.s:P.s;e[f+"0"]=e[f+"1"]=C.c2p(P[f],!0),e[f+"LabelVal"]=D;var z=m.extents[m.extents.round(P.p)];return e[u+"0"]=S.c2p(y?k(P):z[0],!0),e[u+"1"]=S.c2p(y?T(P):z[1],!0),e[u+"LabelVal"]=P.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(P)+function(e){return M(_(e),w(e))}(P))/2-b,e[u+"Spike"]=S.c2p(P.p,!0),o(P,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":43,"../../components/fx":83,"../../constants/numerical":148,"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":254,"./helpers":270}],272:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":225,"../scatter/marker_colorbar":312,"./arrays_to_calcdata":263,"./attributes":264,"./calc":265,"./cross_trace_calc":267,"./defaults":268,"./event_data":269,"./hover":271,"./layout_attributes":273,"./layout_defaults":274,"./plot":275,"./select":276,"./style":278}],273:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],274:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,R),B=G(B,N,R),H=G(H,j,!R),j=G(j,H,!R)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&I){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,k=t.xaxis,A=t.yaxis,O=e._fullLayout;function P(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var D=n[0].trace,z="h"===D.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,k,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(D,a);var R="stack"===v.mode||"relative"===v.mode,I=n[a],F=!R||I._outmost;if(!E||"none"===w||(I.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],D),H=h.getInsideTextFont(D,a,N,B),j=h.getOutsideTextFont(D,a,N),V=r.datum();z?"log"===k.type&&V.s0<=0&&(l=k.range[0]=G*(W/Z):W>=Z*(Y/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){X=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=P(r,E,X)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=D.textangle;"outside"===w?(te="both"===D.constraintext||"outside"===D.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,M=0,A=l?T(t,e):T(r,n);l?(b=t-A*o,k=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re})):(te="both"===D.constraintext||"inside"===D.constraintext,ee=C(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re,anchor:D.insidetextanchor}));ee.fontSize=X.size,d(D.type,ee,O),I.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,D,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,D,t,v)},toMoveInsideBar:C}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx/helpers":79,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"./attributes":264,"./constants":266,"./helpers":270,"./style":278,"./uniform_text":280,d3:7,"fast-isnumeric":9}],276:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":43,"../../components/drawing":65,"../../lib":168,"../../registry":254,"./attributes":264,"./helpers":270,"./uniform_text":280,d3:7}],279:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54}],280:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":168,"../../plots/domain":239,"../bar/defaults":268,"./attributes":281,"fast-isnumeric":9}],285:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":79}],286:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,k=0;k=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:T(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:T(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function T(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),P(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var k=p.hole;if(a.v===d.vTotal){var T="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";k?_.attr("d","M"+(o+k*a.px0[0])+","+(u+k*a.px0[1])+O(a.px0,a.pxmid,!1,k)+O(a.pxmid,a.px0,!1,k)+"Z"+T):_.attr("d",T)}else{var M=O(a.px0,a.px1,!0,1);if(k){var A=1-k;_.attr("d","M"+(o+k*a.px1[0])+","+(u+k*a.px1[1])+O(a.px1,a.px0,!1,k)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}z(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var k=m.textPosAngle,T=void 0===k?a.pxmid:D(d.r,k);if(m.targetX=o+T[0]*m.rCenter+(m.x||0),m.targetY=u+T[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),k=p.domain,T=i.w*(k.x[1]-k.x[0]),M=i.h*(k.y[1]-k.y[0]),A=(.5*T-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:k.x[0]-A,xr:k.x[1]+A,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:P,attachFxHandlers:m,computeTransform:E}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx":83,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../bar/constants":266,"../bar/uniform_text":280,"./event_data":285,"./helpers":286,d3:7}],291:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":280,"./style_one":292,d3:7}],292:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":43,"./helpers":286}],293:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],301:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=D[O][1])>=G&&(E=D[O-1][0],R=D[O][0],F-I&&(z=E+(R-E)*(G-I)/(F-I),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":43,"../../components/fx":83,"../../lib":168,"../../registry":254,"./get_trace_color":304}],306:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":225,"./arrays_to_calcdata":293,"./attributes":294,"./calc":295,"./cross_trace_calc":299,"./cross_trace_defaults":300,"./defaults":301,"./format_labels":303,"./hover":305,"./marker_colorbar":312,"./plot":314,"./select":315,"./style":317,"./subtypes":318}],307:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"../../lib":168}],308:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,T,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,E=t.baseTolerance,R=t.shape,I="linear"===R,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),J=null,W=Q=0}function fe(e){if(M=e[0]/P,A=e[1]/D,X=e[0]re?re:0,Y=e[1]ae?ae:0,X||Y){if(V)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else $=K(j[V-1],e)[0],j[V++]=$;else j[V++]=[X||e[0],Y||e[1]];var r=j[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(J&&(W!==X&&Q!==Y?ce(W&&Q?(n=J,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||X,Q||Y]):W&&Q&&ce([W,Q])),ce([X,Y])):W-X&&Q-Y&&ce([X||W,Y||Q]),J=e,W=X,Q=Y}else J&&ue(K(J,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===R||"spline"===R?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}J&&ce([W||J[0],Q||J[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":148,"../../lib":168,"./constants":298}],309:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],310:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":9}],312:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],313:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"./subtypes":318}],314:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),T=o(k,"g","errorbars"),M=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,T,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var P,D,z="",E=[],R=_._prevtrace;R&&(z=R._prevRevpath||"",C=R._nextFill,E=R._polygons);var I,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):I=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);y(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var k,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,e),s.setClipUrl(L,Y,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function J(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":65,"../../lib":168,"../../lib/polygon":180,"../../registry":254,"./line_points":308,"./link_traces":310,"./subtypes":318,d3:7}],315:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],20:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(R(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],27:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],28:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":202,"../../plots/cartesian/constants":218,"../../plots/font_attributes":240,"./arrow_paths":27}],29:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":168,"../../plots/cartesian/axes":212,"./draw":34}],30:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(U=!0):U=!0),X=te._offset+te.r2p(t[$]),Q=.5}else"x"===$?(W=t[$],X=b.l+b.w*W):(W=1-t[$],X=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=X;var ue=t["a"+$];J=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),Y=J):(se.tail=X+ue,Y=J+ue),se.text=se.tail+J;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else Y=J=ie*j(Q,oe),se.text=X+J;se.text+=le,J+=le,Y+=le,t["_"+$+"padplus"]=ie/2+Y,t["_"+$+"padminus"]=ie/2-Y,t["_"+$+"size"]=ie,t["_"+$+"shift"]=J}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,E/2,E/2,R-E,H-E),z.call(c.setTranslate,Math.round(L.x.text-R/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),E=m-.5*P,R=E+P,I=y-.5*D,N=I+D,B=[[E,I,E,N],[E,N,R,N],[R,N,R,I],[R,I,E,I]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/X,Z+=t.standoff*(h-f)/X}var Y,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);Y=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),T("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&T("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&T("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),P)p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?T("ax",l.p2r(l.r2p(t.ax)+e)):T("ax",t.ax+e),t.ayref===t.yref?T("ay",v.p2r(v.r2p(t.ay)+r)):T("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var k=y*Math.cos(s),T=y*Math.sin(s);o.x-=k,o.y-=T,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":243,"../annotations/draw":34}],41:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));Z*=W*c.roundUp(Y/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+I-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,J=e.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+T.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+I-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+T.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(P);m.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=H+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),k=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:$,path:l.makeTickPath(G,b,C),transFn:k}),l.drawLabels(r,G,{vals:w,layer:$,transFn:k,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((Q=J.select("text")).node()&&!Q.classed(T.jsPlaceholder)){var a,o=J.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(J.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+T.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+T.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/extend":163,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../plots/cartesian/axis_defaults":214,"../../plots/cartesian/layout_attributes":226,"../../plots/cartesian/position_defaults":229,"../../plots/plots":246,"../../registry":254,"../color":43,"../colorscale/helpers":54,"../dragelement":62,"../drawing":65,"../titles":138,"./constants":45,d3:7,tinycolor2:26}],48:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":168}],49:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":44,"./defaults":46,"./draw":47,"./has_colorbar":48}],50:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":183,"../colorbar/attributes":44,"./scales.js":58}],51:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":168,"./helpers":54,"fast-isnumeric":9}],52:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],60:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":168}],61:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],62:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":168,"../../plots/cartesian/constants":218,"./align":59,"./cursor":60,"./unhover":63,"has-hover":11,"has-passive-events":12,"mouse-event-offset":15}],63:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":161,"../../lib/events":162,"../../lib/throttle":190,"../fx/constants":77}],64:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],65:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=T[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=v),P++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var R=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(R);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":79,"../../constants/alignment":145,"../../constants/interactions":147,"../../constants/xmlns_namespaces":149,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":254,"../../traces/scatter/make_bubble_size_func":311,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale":55,"./symbol_defs":66,d3:7,"fast-isnumeric":9,tinycolor2:26}],66:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:7}],67:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],68:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":318,"../drawing":65,d3:7,"fast-isnumeric":9}],73:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":43,d3:7}],74:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":163,"../../plots/font_attributes":240,"./layout_attributes":84}],75:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),R="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(R[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==Y&&0===W.length){G.distance=Y,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=Y}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>p.spikeDistance)&&(J.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>p.spikeDistance)&&(J.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:Te,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Le,Te?"xa":"ya",u),O(Le,Te));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:R})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,E=D.width,R=D.height,I=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-T)+",0L"+S+","+A+T+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"H"+(S-2*T)+"Z")):l.attr("d","M0,0L"+T+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+T+"H-"+T+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=k._offset+k._length):(C="end",P=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+T+","+T+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+T+"V-"+T+"Z");var E,R=x.height/2,I=z-x.top-R,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=$+ne>=R;return ne<=R&&($<=z?$=L._offset+2*M:ae&&($=R-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=D.width+T+M+k;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=F,S=N+H/2+j<=R,P=N-H/2-j>=0,"top"!==e.idealAlign&&S||!P?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,P=F-B/2-j>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(T+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*T+d)+","+(T+p)+"v"+(e.by/2-T)+"h"+o*e.bx+"v-"+e.by+"H"+(o*T+d)+"V"+(p-T)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:T,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?k:-k),cy:m,r:k,fill:T}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,R=n.spikethickness,I=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=F,D=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),P=s.t+(1-B)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":R,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":R+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?R:-R),r:R,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":168,"../../lib/events":162,"../../lib/override_cursor":179,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"../legend/defaults":95,"../legend/draw":96,"./constants":77,"./helpers":79,d3:7,"fast-isnumeric":9,tinycolor2:26}],81:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":168,"../color":43,"./helpers":79}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===T("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/layout_attributes":244,"../../registry":254,"./attributes":93,"./helpers":99}],96:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),k=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var E=z.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(k?M&&"left"===w?o.l+o.w:S:T?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var P=0;if(s){var D=0,z=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,E+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,E),z+=r})),a._width=Math.max(P,z)+u,a._height=E+D+g}else{var R=r.size(),I=O+f+(R-1)*ha._maxWidth&&(P=Math.max(P,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),I?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,T=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=T;w=a.constrain(w,0,l.width-t._width),T=a.constrain(T,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,T),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,E,R,I=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-I-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,I,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),I,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(R,z,E),I,B))}));D.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,R=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(R,z,E),I,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":145,"../../lib":168,"../../lib/events":162,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../dragelement":62,"../drawing":65,"./constants":94,"./get_legend_data":97,"./handle_click":98,"./helpers":99,"./style":101,d3:7}],97:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),k=f||m,T=p||v,M=w||!k?"M5,0":T?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":168,"../../registry":254,"../../traces/pie/helpers":286,"../../traces/pie/style_one":292,"../../traces/scatter/subtypes":318,"../color":43,"../colorscale/helpers":54,"../drawing":65,d3:7}],102:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=I[r+1];else if(e=n.pmax)t=I[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(T=f,S="y0",M=y,C="y1"):(T=y,S="y1",M=f,C="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?Y:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),J(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;J(l)}};function X(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),R?N("yanchor",r.yanchor=U(k+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),R?N("yanchor",r.yanchor=U(k+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=R?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=R?d:U(d))}else if("resize-over-end-point"===z){var p=v+n,h=R?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=R?h:U(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),X=m("e"),Y=b?T+a:T,W=G?M+a:M,J=Z?A+n:A,$=X?L+n:L;R&&(b&&(Y=T-a),G&&(W=M-a)),(!R&&W-Y>10||R&&Y-W>10)&&(N(S,r[S]=R?Y:U(Y)),N(C,r[C]=R?W:U(W))),$-J>10&&(N(O,r[O]=E?J:q(J)),N(P,r[P]=E?$:q($)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||R)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(R?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&R){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function J(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=X}(e,E,s,t,r,z):!0===s.editable&&E.style("pointer-events",P||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),k=Math.abs(_-u),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(T=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(T,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(R),D&&(L?E.on(".opacity",null):(T=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":145,"../../constants/interactions":147,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../../registry":254,"../color":43,"../drawing":65,d3:7,"fast-isnumeric":9}],139:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":163,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/font_attributes":240,"../../plots/pad_attributes":245,"../color/attributes":42}],140:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":139,"./constants":140}],142:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>k,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,E=v;z+P>s&&(z=s-P);var R=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=R.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:E,width:P,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+P+.5:f+.5,B=d-.5,H=T?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":43,"../drawing":65,d3:7}],145:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],146:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],147:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],148:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],149:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],150:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],153:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],154:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":175}],155:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(T,P.toMonthIndex(T,M,D),A)}else O=P.newDate(T,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(T),z.getUTCMonth()!==M||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,T=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":175}],167:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],168:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function T(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":148,"./anchor_utils":153,"./angles":154,"./array":155,"./clean_number":156,"./clear_responsive":158,"./coerce":159,"./dates":160,"./dom":161,"./extend":163,"./filter_unique":164,"./filter_visible":165,"./geometry2d":166,"./identity":167,"./is_plain_object":169,"./keyed_container":170,"./localize":171,"./loggers":172,"./make_trace_groups":173,"./matrix":174,"./mod":175,"./nested_property":176,"./noop":177,"./notifier":178,"./push_unique":181,"./regex":183,"./relative_attr":184,"./relink_private":185,"./search":186,"./stats":188,"./throttle":190,"./to_log_range":191,d3:7,"fast-isnumeric":9}],169:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],170:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":200,"./notifier":178}],173:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:7}],174:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],176:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":148,"./matrix":174}],181:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":155,"fast-isnumeric":9}],189:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],191:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":9}],192:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],193:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],194:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===D)E=L;else{for(z=Math.max(C.length,z),E=[],x=0;x=D);x++)E.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),i.colorbars&&l.push(T.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[R];)R--;var I=z.parts[R],F=z.parts[R-1]+"."+I,H=z.parts.slice(0,R).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=z.get();if(void 0!==E){T[D]=E,L[D]="reverse"===I?E:N(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var J="height"===D?"width":"height";S(J,s[J])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))P(F),l(s,H+"._inputRange").set(null);else if(F.match(X)){P(F),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Y)&&l(s,H+"._inputDomain").set(null);if("type"===I){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[D]}else"reverse"===I?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&TT)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":209}],203:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var T=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?k(u,T,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(y(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,R,I,F,N,B,H,j,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(M);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":168,"../plots/attributes":209,"../plots/plots":246,"./plot_config":200,"./plot_schema":201,"./plot_template":202}],205:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(T);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(T,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":168,"../plots/plots":246,"../snapshot/helpers":258,"../snapshot/svgtoimg":260,"../snapshot/tosvg":262,"../version":321,"./plot_api":199,"fast-isnumeric":9}],206:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(T);if(P&&(O=Math.min(O,T.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,T[A].length):D);M++)L=P?T[A][M]:T,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(k)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=T?[Math.max(0,C),Math.max(1,O)]:[C,O]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":148,"../../lib":168,"../../registry":254,"fast-isnumeric":9}],212:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),T=k.MID_SHIFT,M=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(X(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,I)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,I))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,I)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,I));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||X(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function X(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":X(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||Y&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*T},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||k)for(r=0;rz&&IP&&(P=I);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:P,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){Te="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(Te="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){Te="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":168,"fast-isnumeric":9}],230:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":145}],231:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,T=e("./constants"),M=T.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,P=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!H){var r=Y.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,X,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&X.emit("plotly_selected",void 0);l.click(X,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":43,"../../components/dragelement/helpers":61,"../../components/drawing":65,"../../components/fx":83,"../../components/fx/helpers":79,"../../components/shapes/draw_newshape/display_outlines":128,"../../components/shapes/draw_newshape/helpers":129,"../../components/shapes/draw_newshape/newshapes":130,"../../lib":168,"../../lib/clear_gl_canvases":157,"../../lib/polygon":180,"../../lib/throttle":190,"../../plot_api/subroutines":203,"../../registry":254,"./axis_ids":215,"./constants":218,"./handle_outline":222,"./helpers":223,polybooljs:17}],232:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function T(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(T(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var E=function(t){return a(t)?D(t,e._m,e._b):p},R=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},R=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?k:c,e.l2p=E,e.p2l=R,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return k(R(e))}:R,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=R,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(R(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=R,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(R(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,T=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":65,"../../lib":168,"../../registry":254,"./axes":212,d3:7}],237:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),S(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,L=h[M].r.size;if(A>_){var C=(w*A+(L-d)*_)/(A-_),O=(L*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(T)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>k){var z=(T*P+(D-p)*k)/(P-k),E=(D*(1-k)+(T-p)*(1-P))/(P-k);z>=0&&E>=0&&p-(E+z)>0&&z+E>f+u&&(f=z,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var R=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(D(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);M&&!T&&(S=0);var C=L.slice();A&&T&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(E)}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 R,I=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:R,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),R.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+X(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=X(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));R.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!T){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};T&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":145,"../../../lib":168,d3:7}],251:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":43,"../../../lib":168,"./micropolar":250,"./undo_manager":252,d3:7}],252:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":43,"../components/drawing":65,"../constants/xmlns_namespaces":149,"../lib":168,d3:7}],263:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(k=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},T=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var P=g[e.index],D=v.base?P.b+P.s:P.s;e[f+"0"]=e[f+"1"]=C.c2p(P[f],!0),e[f+"LabelVal"]=D;var z=m.extents[m.extents.round(P.p)];return e[u+"0"]=S.c2p(y?k(P):z[0],!0),e[u+"1"]=S.c2p(y?T(P):z[1],!0),e[u+"LabelVal"]=P.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(P)+function(e){return M(_(e),w(e))}(P))/2-b,e[u+"Spike"]=S.c2p(P.p,!0),o(P,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":43,"../../components/fx":83,"../../constants/numerical":148,"../../lib":168,"../../plots/cartesian/axes":212,"../../registry":254,"./helpers":270}],272:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":225,"../scatter/marker_colorbar":312,"./arrays_to_calcdata":263,"./attributes":264,"./calc":265,"./cross_trace_calc":267,"./defaults":268,"./event_data":269,"./hover":271,"./layout_attributes":273,"./layout_defaults":274,"./plot":275,"./select":276,"./style":278}],273:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],274:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,R),B=G(B,N,R),H=G(H,j,!R),j=G(j,H,!R)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&I){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,k=t.xaxis,A=t.yaxis,O=e._fullLayout;function P(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var D=n[0].trace,z="h"===D.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,k,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(D,a);var R="stack"===v.mode||"relative"===v.mode,I=n[a],F=!R||I._outmost;if(!E||"none"===w||(I.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],D),H=h.getInsideTextFont(D,a,N,B),j=h.getOutsideTextFont(D,a,N),V=r.datum();z?"log"===k.type&&V.s0<=0&&(l=k.range[0]=G*(W/Z):W>=Z*(Y/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){X=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=P(r,E,X)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=D.textangle;"outside"===w?(te="both"===D.constraintext||"outside"===D.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,M=0,A=l?T(t,e):T(r,n);l?(b=t-A*o,k=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re})):(te="both"===D.constraintext||"inside"===D.constraintext,ee=C(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re,anchor:D.insidetextanchor}));ee.fontSize=X.size,d(D.type,ee,O),I.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,D,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,D,t,v)},toMoveInsideBar:C}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx/helpers":79,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":212,"../../registry":254,"./attributes":264,"./constants":266,"./helpers":270,"./style":278,"./uniform_text":280,d3:7,"fast-isnumeric":9}],276:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":43,"../../components/drawing":65,"../../lib":168,"../../registry":254,"./attributes":264,"./helpers":270,"./uniform_text":280,d3:7}],279:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54}],280:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":168,"../../plots/domain":239,"../bar/defaults":268,"./attributes":281,"fast-isnumeric":9}],285:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":79}],286:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,k=0;k=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:T(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:T(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function T(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),P(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var k=p.hole;if(a.v===d.vTotal){var T="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";k?_.attr("d","M"+(o+k*a.px0[0])+","+(u+k*a.px0[1])+O(a.px0,a.pxmid,!1,k)+O(a.pxmid,a.px0,!1,k)+"Z"+T):_.attr("d",T)}else{var M=O(a.px0,a.px1,!0,1);if(k){var A=1-k;_.attr("d","M"+(o+k*a.px1[0])+","+(u+k*a.px1[1])+O(a.px1,a.px0,!1,k)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}z(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var k=m.textPosAngle,T=void 0===k?a.pxmid:D(d.r,k);if(m.targetX=o+T[0]*m.rCenter+(m.x||0),m.targetY=u+T[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),k=p.domain,T=i.w*(k.x[1]-k.x[0]),M=i.h*(k.y[1]-k.y[0]),A=(.5*T-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:k.x[0]-A,xr:k.x[1]+A,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:P,attachFxHandlers:m,computeTransform:E}},{"../../components/color":43,"../../components/drawing":65,"../../components/fx":83,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":246,"../bar/constants":266,"../bar/uniform_text":280,"./event_data":285,"./helpers":286,d3:7}],291:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":280,"./style_one":292,d3:7}],292:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":43,"./helpers":286}],293:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],301:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=D[O][1])>=G&&(E=D[O-1][0],R=D[O][0],F-I&&(z=E+(R-E)*(G-I)/(F-I),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":43,"../../components/fx":83,"../../lib":168,"../../registry":254,"./get_trace_color":304}],306:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":225,"./arrays_to_calcdata":293,"./attributes":294,"./calc":295,"./cross_trace_calc":299,"./cross_trace_defaults":300,"./defaults":301,"./format_labels":303,"./hover":305,"./marker_colorbar":312,"./plot":314,"./select":315,"./style":317,"./subtypes":318}],307:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"../../lib":168}],308:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,T,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,E=t.baseTolerance,R=t.shape,I="linear"===R,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),J=null,W=Q=0}function fe(e){if(M=e[0]/P,A=e[1]/D,X=e[0]re?re:0,Y=e[1]ae?ae:0,X||Y){if(V)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else $=K(j[V-1],e)[0],j[V++]=$;else j[V++]=[X||e[0],Y||e[1]];var r=j[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(J&&(W!==X&&Q!==Y?ce(W&&Q?(n=J,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||X,Q||Y]):W&&Q&&ce([W,Q])),ce([X,Y])):W-X&&Q-Y&&ce([X||W,Y||Q]),J=e,W=X,Q=Y}else J&&ue(K(J,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===R||"spline"===R?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}J&&ce([W||J[0],Q||J[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":148,"../../lib":168,"./constants":298}],309:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],310:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":9}],312:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],313:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/helpers":54,"./subtypes":318}],314:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),T=o(k,"g","errorbars"),M=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,T,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var P,D,z="",E=[],R=_._prevtrace;R&&(z=R._prevRevpath||"",C=R._nextFill,E=R._polygons);var I,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):I=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);y(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var k,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,e),s.setClipUrl(L,Y,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function J(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":65,"../../lib":168,"../../lib/polygon":180,"../../registry":254,"./line_points":308,"./link_traces":310,"./subtypes":318,d3:7}],315:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r 0) { var factor = 1 - 2 * frameMargins; @@ -89947,7 +89956,7 @@ module.exports = function style(gd) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[11])(11) }); diff --git a/dist/plotly-cartesian.min.js b/dist/plotly-cartesian.min.js index e832f3ac578..1752293f565 100644 --- a/dist/plotly-cartesian.min.js +++ b/dist/plotly-cartesian.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (cartesian - minified) v1.54.2 +* plotly.js (cartesian - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -18,4 +18,4 @@ * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":27,"./lib/epsilon":28,"./lib/geojson":29,"./lib/intersecter":30,"./lib/segment-chainer":32,"./lib/segment-selector":33}],27:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],28:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],29:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[D(i(e).toString(16)),D(i(t).toString(16)),D(i(r).toString(16)),D(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function z(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function D(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],36:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],37:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":212,"../../plots/cartesian/constants":228,"../../plots/font_attributes":250,"./arrow_paths":36}],38:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":178,"../../plots/cartesian/axes":222,"./draw":43}],39:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+J]))<0||ce>1)&&(U=!0):U=!0),X=te._offset+te.r2p(t[J]),Q=.5}else"x"===J?(W=t[J],X=b.l+b.w*W):(W=1-t[J],X=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=X;var ue=t["a"+J];$=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),Y=$):(se.tail=X+ue,Y=$+ue),se.text=se.tail+$;var fe=x["x"===J?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else Y=$=ie*j(Q,oe),se.text=X+$;se.text+=le,$+=le,Y+=le,t["_"+J+"padplus"]=ie/2+Y,t["_"+J+"padminus"]=ie/2-Y,t["_"+J+"size"]=ie,t["_"+J+"shift"]=$}if(U)D.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(P-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:R+he-1,y:R+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=R+ge-h.top,me=R+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,R,R,w,P),F.call(c.setRect,E/2,E/2,I-E,H-E),D.call(c.setTranslate,Math.round(L.x.text-I/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),z=+F.attr("width"),P=+F.attr("height"),E=m-.5*z,I=E+z,R=y-.5*P,N=R+P,B=[[E,R,E,N],[E,N,I,N],[I,N,I,R],[I,R,E,R]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/X,Z+=t.standoff*(h-f)/X}var Y,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(D);Y=e.x,W=e.y,l&&l.autorange&&T(l._name+".autorange",!0),v&&v.autorange&&T(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,W),a=n[0]+e,i=n[1]+r;D.call(c.setTranslate,a,i),k("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),k("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&k("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&k("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),z)p.init({element:D.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?k("ax",l.p2r(l.r2p(t.ax)+e)):k("ax",t.ax+e),t.ayref===t.yref?k("ay",v.p2r(v.r2p(t.ay)+r)):k("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}k("x",a),k("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(D,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(D),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void z();if(m){if(m*m>x*x+b*b)return void z();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void z();var T=y*Math.cos(s),k=y*Math.sin(s);o.x-=T,o.y-=k,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":253,"../annotations/draw":43}],50:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));Z*=W*c.roundUp(Y/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+R-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,$=e.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),J=e.select("."+k.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+R-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+k.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),J.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(z);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(z[i]+z[i-1])/2,i===z.length-1?A[1]:(z[i]+z[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(D,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?P:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+D).call(d.lineGroupStyle,v.width,L(e),v.dash)})),J.selectAll("g."+G._id+"tick,path").remove();var b=H+D+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),T=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:J,path:l.makeTickPath(G,b,C),transFn:T}),l.drawLabels(r,G,{vals:w,layer:J,transFn:T,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=D+t.outlinewidth/2+d.bBox(J.node()).width;if((Q=$.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=$.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox($.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(D,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=T[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=T[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-D;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":154,"../../lib":178,"../../lib/extend":173,"../../lib/setcursor":197,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":256,"../../registry":269,"../color":52,"../colorscale/helpers":63,"../dragelement":71,"../drawing":74,"../titles":147,"./constants":54,d3:16,tinycolor2:35}],57:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":178}],58:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":53,"./defaults":55,"./draw":56,"./has_colorbar":57}],59:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":193,"../colorbar/attributes":53,"./scales.js":67}],60:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":178,"./helpers":63,"fast-isnumeric":18}],61:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],69:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":178}],70:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],71:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":178,"../../plots/cartesian/constants":228,"./align":68,"./cursor":69,"./unhover":72,"has-hover":20,"has-passive-events":21,"mouse-event-offset":24}],72:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":171,"../../lib/events":172,"../../lib/throttle":200,"../fx/constants":86}],73:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],74:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=k[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},z=0),r&&(m.savedBBoxes[r]=v),z++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",D(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(I);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":88,"../../constants/alignment":154,"../../constants/interactions":157,"../../constants/xmlns_namespaces":159,"../../lib":178,"../../lib/svg_text_utils":199,"../../registry":269,"../../traces/scatter/make_bubble_size_func":406,"../../traces/scatter/subtypes":413,"../color":52,"../colorscale":64,"./symbol_defs":75,d3:16,"fast-isnumeric":18,tinycolor2:35}],75:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:16}],76:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],77:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":413,"../drawing":74,d3:16,"fast-isnumeric":18}],82:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":52,d3:16}],83:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":173,"../../plots/font_attributes":250,"./layout_attributes":93}],84:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),I="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(I[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==Y&&0===W.length){G.distance=Y,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=Y}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!$.vLinePoint||$.vLinePoint.spikeDistance>p.spikeDistance)&&($.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!$.hLinePoint||$.hLinePoint.spikeDistance>p.spikeDistance)&&($.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&J&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:ke,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],T=w.datum;T.offset=w.dp,T.del=w.del}}}(Le,ke?"xa":"ya",u),O(Le,ke));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:I})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],T=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],z=(String(O)||"").split(" ")[0],P=p.node().getBoundingClientRect(),D=P.top,E=P.width,I=P.height,R=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(R){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-k)+",0L"+S+","+A+k+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+k+"H"+(S-2*k)+"Z")):l.attr("d","M0,0L"+k+","+A+k+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+k+"H-"+k+"Z")}else{var C,z,P;"right"===L.side?(C="start",z=1,P="",m=T._offset+T._length):(C="end",z=-1,P="-",m=T._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+P+k+","+k+"V"+(M+x.height/2)+"h"+P+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+P+k+"V-"+k+"Z");var E,I=x.height/2,R=D-x.top-I,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=J+ne>=I;return ne<=I&&(J<=D?J=L._offset+2*M:ae&&(J=I-ne)),ee.attr("transform","translate("+K+","+J+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,R,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),T=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();T=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,z,P=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=P.width+k+M+T;if(e.ty0=D-P.top,e.bx=P.width+2*M,e.by=Math.max(P.height+2*M,A),e.anchor="start",e.txwidth=P.width,e.tx2width=T,e.offset=0,l)e.pos=F,S=N+H/2+j<=I,z=N-H/2-j>=0,"top"!==e.idealAlign&&S||!z?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,z=F-B/2-j>=0,"left"!==e.idealAlign&&S||!z)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),T&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(k+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-T,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*k+d)+","+(k+p)+"v"+(e.by/2-k)+"h"+o*e.bx+"v-"+e.by+"H"+(o*k+d)+"V"+(p-k)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function P(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var z,P,D=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||D,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(z=F,P=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),z=s.t+(1-B)*s.h,P=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:z,y2:P,"stroke-width":I,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:z,y2:P,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:R}).classed("spikeline",!0)}}}function D(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":178,"../../lib/events":172,"../../lib/override_cursor":189,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":269,"../color":52,"../dragelement":71,"../drawing":74,"../legend/defaults":104,"../legend/draw":105,"./constants":86,"./helpers":88,d3:16,"fast-isnumeric":18,tinycolor2:35}],90:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":178,"../color":52,"./helpers":88}],91:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":178,"../../plot_api/plot_template":212,"../../plots/layout_attributes":254,"../../registry":269,"./attributes":102,"./helpers":108}],105:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?T(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var z=a.ensureSingle(C,"text","legendtitletext");z.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(z,C,e,t)}else C.selectAll(".legendtitletext").remove();var P=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),D=C.selectAll("g.groups").data(d);D.enter().append("g").attr("class","groups"),D.exit().remove();var E=D.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var z=0;if(s){var P=0,D=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),P=Math.max(P,t);var r=e+h;r+u+D>a._maxWidth&&(z=Math.max(z,D),D=0,E+=P+a.tracegroupgap,P=t),c.setTranslate(this,D,E),D+=r})),a._width=Math.max(z,D)+u,a._height=E+P+g}else{var I=r.size(),R=O+f+(I-1)*ha._maxWidth&&(z=Math.max(z,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(z,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,D,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,k=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-t._width),k=a.constrain(k,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,k),P.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var z=t._effHeight;t._main||(z=t._height),S.attr({width:t._width-b,height:z-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:t._width-2*b,height:z-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(P,0,0,0,0),delete t._scrollY}else{var D,E,I,R=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-R-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,R,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),R,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;D="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(I,D,E),R,B))}));P.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(D=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(I,D,E),R,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(P,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":154,"../../lib":178,"../../lib/events":172,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../../registry":269,"../color":52,"../dragelement":71,"../drawing":74,"./constants":103,"./get_legend_data":106,"./handle_click":107,"./helpers":108,"./style":110,d3:16}],106:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=f||m,k=p||v,M=w||!T?"M5,0":k?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":178,"../../registry":269,"../../traces/pie/helpers":381,"../../traces/pie/style_one":387,"../../traces/scatter/subtypes":413,"../color":52,"../colorscale/helpers":63,"../drawing":74,d3:16}],111:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=R[r+1];else if(e=n.pmax)t=R[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===D?Y:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;$(l)}};function X(r){if(m(e))D=null;else if(R)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),D=s.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),I?N("yanchor",r.yanchor=U(T+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===D){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=I?d:U(d))}else if("resize-over-end-point"===D){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=I?h:U(h))}}else{var m=function(e){return-1!==D.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),X=m("e"),Y=b?k+a:k,W=G?M+a:M,$=Z?A+n:A,J=X?L+n:L;I&&(b&&(Y=k-a),G&&(W=M-a)),(!I&&W-Y>10||I&&Y-W>10)&&(N(S,r[S]=I?Y:U(Y)),N(C,r[C]=I?W:U(W))),J-$>10&&(N(O,r[O]=E?$:q($)),N(z,r[z]=E?J:q(J)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=X}(e,E,s,t,r,D):!0===s.editable&&E.style("pointer-events",z||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),T=Math.abs(_-u),k="A"+w+","+T,M=b+w+","+_;return"M"+M+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(k=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(I),P&&(L?E.on(".opacity",null):(k=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":154,"../../constants/interactions":157,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../../registry":269,"../color":52,"../drawing":74,d3:16,"fast-isnumeric":18}],148:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":173,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":255,"../color/attributes":51}],149:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":178,"../../plots/array_container_defaults":218,"./attributes":148,"./constants":149}],151:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>T,z=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,D=h+g,E=v;D+z>s&&(D=s-z);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:D,y:E,width:z,height:P}),this._vbarYMin=E+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+z+.5:f+.5,B=d-.5,H=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+R).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":178,"../color":52,"../drawing":74,d3:16}],154:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],155:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],156:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],157:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],158:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],159:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],160:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],163:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],164:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":185}],165:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var z=v.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===M.charAt(M.length-1);M=parseInt(M,10),O=z.newDate(k,z.toMonthIndex(k,M,P),A)}else O=z.newDate(k,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,L,S));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?u:D.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,k=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":185}],177:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],178:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var T=e("./dom");function k(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return D.apply(O,arguments)};var z={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return D.apply(z,arguments)};var P=/^[:|\|]/;function D(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":158,"./anchor_utils":163,"./angles":164,"./array":165,"./clean_number":166,"./clear_responsive":168,"./coerce":169,"./dates":170,"./dom":171,"./extend":173,"./filter_unique":174,"./filter_visible":175,"./geometry2d":176,"./identity":177,"./is_plain_object":179,"./keyed_container":180,"./localize":181,"./loggers":182,"./make_trace_groups":183,"./matrix":184,"./mod":185,"./nested_property":186,"./noop":187,"./notifier":188,"./push_unique":191,"./regex":193,"./relative_attr":194,"./relink_private":195,"./search":196,"./stats":198,"./throttle":200,"./to_log_range":201,d3:16,"fast-isnumeric":18}],179:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],180:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":188}],183:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:16}],184:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],186:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":158,"./matrix":184}],191:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":165,"fast-isnumeric":18}],199:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return z(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):z(),e}function z(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],201:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":18}],202:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),z=[],P=-1,D=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?z.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(b=0;b=0;x--)C.splice(z[x],1),O&&O.splice(z[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===P)E=L;else{for(D=Math.max(C.length,D),E=[],x=0;x=P);x++)E.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),D(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&D(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in D(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=P(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),T.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof D.parts[I];)I--;var R=D.parts[I],F=D.parts[I-1]+"."+R,H=D.parts.slice(0,I).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=D.get();if(void 0!==E){k[P]=E,L[P]="reverse"===R?E:N(U);var G=f.getLayoutValObject(s,D.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(P,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(P))if(E){S("autosize",null);var $="height"===P?"width":"height";S($,s[$])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))z(F),l(s,H+"._inputRange").set(null);else if(F.match(X)){z(F),l(s,H+"._inputRange").set(null);var J=l(s,H).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else F.match(Y)&&l(s,H+"._inputDomain").set(null);if("type"===R){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete s[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var ae=l(s,P).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(P);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[P]=null:w.isRemoveVal(E)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[P]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,D.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,T.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":178,"../plots/attributes":219}],213:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,z=l.plotgroup;if(y(C,O,L)){var P=z.node(),D=l.bg=o.ensureSingle(z,"rect","bg");P.insertBefore(D.node(),P.childNodes[0]),A.push(a)}else z.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(M);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":178,"../plots/attributes":219,"../plots/plots":256,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(k);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":178,"../plots/plots":256,"../snapshot/helpers":273,"../snapshot/svgtoimg":275,"../snapshot/tosvg":277,"../version":435,"./plot_api":209,"fast-isnumeric":18}],216:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,z=Array.isArray(k);if(z&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var P=x[A].length;for(M=0;M<(z?Math.min(P,k[A].length):P);M++)L=z?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(T)if(0===d)i=[0,1];else{var z=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),P=d/(1-Math.min(.5,z/M));i=d>0?[0,P]:[P,0]}else i=k?[Math.max(0,C),Math.max(1,O)]:[C,O]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return T=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=P;a--)z(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":158,"../../lib":178,"../../registry":269,"fast-isnumeric":18}],222:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,T=e("../../constants/alignment"),k=T.MID_SHIFT,M=T.CAP_SHIFT,A=T.LINE_SPACING,L=T.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var z=e("./autorange");S.getAutoRange=z.getAutoRange,S.findExtremes=z.findExtremes;function P(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=P(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(X(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,R)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,R))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,R)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,R));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||X(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function X(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":X(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=J(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||Y&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+J(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*k},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],$);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||T)for(r=0;rD&&Rz&&(z=R);p/=(z-O)/(2*P),O=c.l2r(O),z=c.l2r(z),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:z,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function ze(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){ke="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(ke="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){ke="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":178,"fast-isnumeric":18}],240:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":154}],241:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,k=e("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,z=C.axValue,P=C.getTransform;function D(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!H){var r=Y.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&D(t,X,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&X.emit("plotly_selected",void 0);l.click(X,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:D}},{"../../components/color":52,"../../components/dragelement/helpers":70,"../../components/drawing":74,"../../components/fx":92,"../../components/fx/helpers":88,"../../components/shapes/draw_newshape/display_outlines":137,"../../components/shapes/draw_newshape/helpers":138,"../../components/shapes/draw_newshape/newshapes":139,"../../lib":178,"../../lib/clear_gl_canvases":167,"../../lib/polygon":190,"../../lib/throttle":200,"../../plot_api/subroutines":213,"../../registry":269,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:26}],242:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(e){return Math.pow(10,e)}function k(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(k(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function z(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function P(e,t,r){return n.round(r+t*e,2)}function D(e,t,r){return(e-r)/t}var E=function(t){return a(t)?P(t,e._m,e._b):p},I=function(t){return D(t,e._m,e._b)};if(e.rangebreaks){var R="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return P(t,e._m,e._b);var n=R;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?P(t,e._m2,f):0},I=function(t){var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return D(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?T:c,e.l2p=E,e.p2l=I,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return T(I(e))}:I,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=I,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return T(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=T,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return T(I(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=I,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(I(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,k=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":74,"../../lib":178,"../../registry":269,"./axes":222,d3:16}],247:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&D.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),L(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,S=h[M].r.size;if(A>_){var C=(w*A+(S-d)*_)/(A-_),O=(S*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(k)&&h[M].t){var z=h[M].t.val,P=h[M].t.size;if(z>T){var D=(k*z+(P-p)*T)/(z-T),E=(P*(1-T)+(k-p)*(1-z))/(z-T);D>=0&&E>=0&&p-(E+D)>0&&D+E>f+u&&(f=D,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(z(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var z=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),C[2]||(C[2]=z);var P=n.range.apply(this,C);if(P=P.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=n.select(E)}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 I,R=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+X(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var $=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=X(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&$.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var J=n.max(R.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));I.attr({transform:"translate("+[x+J,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!k){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":154,"../../../lib":178,d3:16}],261:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":52,"../../../lib":178,"./micropolar":260,"./undo_manager":262,d3:16}],262:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a=u&&(p.min=0,g.min=0,v.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function h(e,t,r,n){var a=f[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=t._name.charAt(0).toUpperCase(),g="Component "+h,v=o("title.text",g);t._hovertitle=v===g?v:h,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear",{}),s(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:f,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":52,"../../lib":178,"../../plot_api/plot_template":212,"../cartesian/line_grid_defaults":238,"../cartesian/tick_label_defaults":243,"../cartesian/tick_mark_defaults":244,"../cartesian/tick_value_defaults":245,"../subplot_defaults":263,"./layout_attributes":266}],268:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o._,s=e("../../components/color"),c=e("../../components/drawing"),u=e("../cartesian/set_convert"),f=e("../../lib/extend").extendFlat,d=e("../plots"),p=e("../cartesian/axes"),h=e("../../components/dragelement"),g=e("../../components/fx"),v=e("../../components/dragelement/helpers"),m=v.freeMode,y=v.rectMode,x=e("../../components/titles"),b=e("../cartesian/select").prepSelect,_=e("../cartesian/select").selectOnClick,w=e("../cartesian/select").clearSelect,T=e("../cartesian/select").clearSelectionsCache,k=e("../cartesian/constants");function M(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=M;var A=M.prototype;A.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},A.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aL*x?a=(i=x)*L:i=(a=y)/L,o=v*a/y,l=m*i/x,r=t.l+t.w*h-a/2,n=t.t+t.h*(1-g)-i/2,d.x0=r,d.y0=n,d.w=a,d.h=i,d.sum=b,d.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[h-o/2,h+o/2],_id:"x"},u(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(e){return e.a>=d.aaxis.range[0]&&e.a<=d.aaxis.range[1]&&e.b>=d.baxis.range[1]&&e.b<=d.baxis.range[0]&&e.c>=d.caxis.range[1]&&e.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[_,b-w-T],domain:[g-l/2,g+l/2],_id:"y"},u(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var k=d.yaxis.domain[0],M=d.aaxis=f({},e.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+l*L],anchor:"free",position:0,_id:"y",_length:a});u(M,d.graphDiv._fullLayout),M.setScale();var A=d.baxis=f({},e.baxis,{range:[b-_-T,w],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(A,d.graphDiv._fullLayout),A.setScale();var S=d.caxis=f({},e.caxis,{range:[b-_-w,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+l*L],anchor:"free",position:0,_id:"y",_length:a});u(S,d.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDef.select("path").attr("d",C),d.layers.plotbg.select("path").attr("d",C);var O="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDefRelative.select("path").attr("d",O);var z="translate("+r+","+n+")";d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),d.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-A._offset)+","+(n+i)+")";d.layers.baxis.attr("transform",P),d.layers.bgrid.attr("transform",P);var D="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-M._offset+")";d.layers.aaxis.attr("transform",D),d.layers.agrid.attr("transform",D);var E="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";d.layers.caxis.attr("transform",E),d.layers.cgrid.attr("transform",E),d.drawAxes(!0),d.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(s.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(s.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",S.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(s.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),c.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},A.drawAxes=function(e){var t=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),e){var s=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=x.draw(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:l(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=x.draw(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:l(t,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},A.drawAx=function(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=p.calcTicks(e),f=p.clipEnds(e,u),d=p.makeTransFn(e),h=p.getTickSigns(e)[2],g=o.deg2rad(30),v=h*(e.linewidth||1)/2,m=h*e.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+v+"l"+Math.sin(g)*m+","+Math.cos(g)*m:"M"+v+",0l"+Math.cos(g)*m+","+-Math.sin(g)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];p.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),p.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),p.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:p.makeLabelFns(e,0,30)})};var S=k.MINZOOM/2+.87,C="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(.87*S+4.5)+"l2.6,1.5l-"+S/2+","+.87*S+"Z",O="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-2.6,1.5l"+S/2+","+.87*S+"Z",z="m0,1l"+S/2+","+.87*S+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-"+(S/2+2.6)+","+(.87*S+4.5)+"l2.6,1.5l"+S/2+",-"+.87*S+"Z",P=!0;function D(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}A.clearSelect=function(){T(this.dragOptions),w(this.dragOptions.gd)},A.initInteractions=function(){var e,t,r,n,u,f,d,p,v,x,w=this,T=w.layers.plotbg.select("path").node(),M=w.graphDiv,A=M._fullLayout._zoomlayer;function S(e){var t={};return t[w.id+".aaxis.min"]=e.a,t[w.id+".baxis.min"]=e.b,t[w.id+".caxis.min"]=e.c,t}function E(e,t){var r=M._fullLayout.clickmode;D(M),2===e&&(M.emit("plotly_doubleclick",null),i.call("_guiRelayout",M,S({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&_(t,M,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&g.click(M,t,w.id)}function I(e,t){return 1-t/w.h}function R(e,t){return 1-(e+(w.h-t)/Math.sqrt(3))/w.w}function F(e,t){return(e-(w.h-t)/Math.sqrt(3))/w.w}function N(a,i){var o=e+a,l=t+i,s=Math.max(0,Math.min(1,I(0,t),I(0,l))),c=Math.max(0,Math.min(1,R(e,t),R(o,l))),h=Math.max(0,Math.min(1,F(e,t),F(o,l))),g=(s/2+h)*w.w,m=(1-s/2-c)*w.w,y=(g+m)/2,b=m-g,_=(1-s)*w.h,T=_-b/L;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),x.transition().style("opacity",1).duration(200),p=!0),M.emit("plotly_relayouting",S(u))}function B(){D(M),u!==r&&(i.call("_guiRelayout",M,S(u)),P&&M.data&&M._context.showTips&&(o.notifier(l(M,"Double-click to zoom back out"),"long"),P=!1))}function H(e,t){var n=e/w.xaxis._m,a=t/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),l=i.indexOf(u.b),s=i.indexOf(u.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),u={a:i[o],b:i[l],c:i[s]},t=(r.a-u.a)*w.yaxis._m,e=(r.c-u.c-r.b+u.b)*w.xaxis._m);var f="translate("+(w.x0+e)+","+(w.y0+t)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d="translate("+-e+","+-t+")";w.clipDefRelative.select("path").attr("transform",d),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),M.emit("plotly_relayouting",S(u))}function j(){i.call("_guiRelayout",M,S(u))}this.dragOptions={element:T,gd:M,plotinfo:{id:w.id,domain:M._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,l){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis];var c=w.dragOptions.dragmode=M._fullLayout.dragmode;m(c)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===c?(w.dragOptions.moveFn=N,w.dragOptions.clickFn=E,w.dragOptions.doneFn=B,function(i,o,l){var c=T.getBoundingClientRect();e=o-c.left,t=l-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,f=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),d="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,v=A.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",d),x=A.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearSelect(M)}(0,o,l)):"pan"===c?(w.dragOptions.moveFn=H,w.dragOptions.clickFn=E,w.dragOptions.doneFn=j,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,w.clearSelect(M)):(y(c)||m(c))&&b(i,o,l,w.dragOptions,c)}},T.onmousemove=function(e){g.hover(M,e,w.id),M._fullLayout._lasthover=T,M._fullLayout._hoversubplot=w.id},T.onmouseout=function(e){M._dragging||h.unhover(M,e)},h.init(this.dragOptions)}},{"../../components/color":52,"../../components/dragelement":71,"../../components/dragelement/helpers":70,"../../components/drawing":74,"../../components/fx":92,"../../components/titles":147,"../../lib":178,"../../lib/extend":173,"../../registry":269,"../cartesian/axes":222,"../cartesian/constants":228,"../cartesian/select":241,"../cartesian/set_convert":242,"../plots":256,d3:16,tinycolor2:35}],269:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in m(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":52,"../components/drawing":74,"../constants/xmlns_namespaces":159,"../lib":178,d3:16}],278:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(T=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var z=g[e.index],P=v.base?z.b+z.s:z.s;e[f+"0"]=e[f+"1"]=C.c2p(z[f],!0),e[f+"LabelVal"]=P;var D=m.extents[m.extents.round(z.p)];return e[u+"0"]=S.c2p(y?T(z):D[0],!0),e[u+"1"]=S.c2p(y?k(z):D[1],!0),e[u+"LabelVal"]=z.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(z)+function(e){return M(_(e),w(e))}(z))/2-b,e[u+"Spike"]=S.c2p(z.p,!0),o(z,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":52,"../../components/fx":92,"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"./helpers":285}],287:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":235,"../scatter/marker_colorbar":407,"./arrays_to_calcdata":278,"./attributes":279,"./calc":280,"./cross_trace_calc":282,"./defaults":283,"./event_data":284,"./hover":286,"./layout_attributes":288,"./layout_defaults":289,"./plot":290,"./select":291,"./style":293}],288:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],289:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,I),B=G(B,N,I),H=G(H,j,!I),j=G(j,H,!I)}var Z=M(i.ensureSingle(P,"path"),z,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!z.uniformtext.mode&&R){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function z(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,D="h"===P.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(P,a);var I="stack"===v.mode||"relative"===v.mode,R=n[a],F=!I||R._outmost;if(!E||"none"===w||(R.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,N,B),j=h.getOutsideTextFont(P,a,N),V=r.datum();D?"log"===T.type&&V.s0<=0&&(l=T.range[0]=G*(W/Z):W>=Z*(Y/G);G>0&&Z>0&&(Q||$||J)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){X=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=z(r,E,X)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,M=0,A=l?k(t,e):k(r,n);l?(b=t-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:D,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=C(l,c,f,p,U,{isHorizontal:D,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=X.size,d(P.type,ee,O),R.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,v)},toMoveInsideBar:C}},{"../../components/color":52,"../../components/drawing":74,"../../components/fx/helpers":88,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":269,"./attributes":279,"./constants":281,"./helpers":285,"./style":293,"./uniform_text":295,d3:16,"fast-isnumeric":18}],291:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":52,"../../components/drawing":74,"../../lib":178,"../../registry":269,"./attributes":279,"./helpers":285,"./uniform_text":295,d3:16}],294:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":52,"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63}],295:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oA.uf};if(t._hasPreCompStats){var F=t[y],N=function(e){return m.d2c((t[e]||[])[r])},B=1/0,H=-1/0;for(r=0;r=A.q1&&A.q3>=A.med){var V=N("lowerfence");A.lf=V!==o&&V<=A.q1?V:d(A,S,C);var q=N("upperfence");A.uf=q!==o&&q>=A.q3?q:p(A,S,C);var U=N("mean");A.mean=U!==o?U:C?i.mean(S,C):(A.q1+A.q3)/2;var G=N("sd");A.sd=U!==o&&G>=0?G:C?i.stdev(S,C,A.mean):A.q3-A.q1,A.lo=h(A),A.uo=g(A);var Z=N("notchspan");Z=Z!==o&&Z>0?Z:v(A,C),A.ln=A.med-Z,A.un=A.med+Z;var X=A.lf,Y=A.uf;t.boxpoints&&S.length&&(X=Math.min(X,S[0]),Y=Math.max(Y,S[C-1])),t.notched&&(X=Math.min(X,A.ln),Y=Math.max(Y,A.un)),A.min=X,A.max=Y}else{var W;i.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+A.q1,"median = "+A.med,"q3 = "+A.q3].join("\n")),W=A.med!==o?A.med:A.q1!==o?A.q3!==o?(A.q1+A.q3)/2:A.q1:A.q3!==o?A.q3:0,A.med=W,A.q1=A.q3=W,A.lf=A.uf=W,A.mean=A.sd=W,A.ln=A.un=W,A.min=A.max=W}B=Math.min(B,A.min),H=Math.max(H,A.max),A.pts2=L.filter(R),k.push(A)}}t._extremes[m._id]=a.findExtremes(m,[B,H],{padded:!0})}else{var Q=m.makeCalcdata(t,y),$=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ee0){var oe,le;if((A={}).pos=A[b]=E[r],L=A.pts=K[r].sort(u),C=(S=A[y]=L.map(f)).length,A.min=S[0],A.max=S[C-1],A.mean=i.mean(S,C),A.sd=i.stdev(S,C,A.mean),A.med=i.interp(S,.5),C%2&&(ae||ie))ae?(oe=S.slice(0,C/2),le=S.slice(C/2+1)):ie&&(oe=S.slice(0,C/2+1),le=S.slice(C/2)),A.q1=i.interp(oe,.5),A.q3=i.interp(le,.5);else A.q1=i.interp(S,.25),A.q3=i.interp(S,.75);A.lf=d(A,S,C),A.uf=p(A,S,C),A.lo=h(A),A.uo=g(A);var se=v(A,C);A.ln=A.med-se,A.un=A.med+se,te=Math.min(te,A.ln),re=Math.max(re,A.un),A.pts2=L.filter(R),k.push(A)}t._extremes[m._id]=a.findExtremes(m,t.notched?Q.concat([te,re]):Q,{padded:!0})}return function(e,t){if(i.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(k[0].t={num:_[M],dPos:I,posLetter:b,valLetter:y,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean?l(e,"mean \xb1 \u03c3:"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},_[M]++,k):[{t:{empty:!0}}]};var s={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in s)i.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?i.isArrayOrTypedArray(t[n][r[0]])&&(e[s[n]]=t[n][r[0]][r[1]]):e[s[n]]=t[n][r])}function u(e,t){return e.v-t.v}function f(e){return e.v}function d(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(i.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function p(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(i.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function h(e){return 4*e.q1-3*e.q3}function g(e){return 4*e.q3-3*e.q1}function v(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"fast-isnumeric":18}],298:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],g=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var U=S.pointpos,G=S.jitter,Z=S.marker.size/2,X=0;U+G>=0&&((X=V*(U+G))>A?(q=!0,H=Z,N=X):X>R&&(H=Z,N=A)),X<=A&&(N=A);var Y=0;U-G<=0&&((Y=-V*(U-G))>L?(q=!0,j=Z,B=Y):Y>F&&(j=Z,B=L)),Y<=L&&(B=L)}else N=A,B=L;var W=new Array(c.length);for(s=0;s0?(v="v",m=x>0?Math.min(_,b):Math.min(b)):x>0?(v="h",m=Math.min(_)):m=0;if(m){t._length=m;var M=r("orientation",v);t._hasPreCompStats?"v"===M&&0===x?(r("x0",0),r("dx",1)):"h"===M&&0===y&&(r("y0",0),r("dy",1)):"v"===M&&0===x?r("x0"):"h"===M&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function u(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,s,"marker.outliercolor"),l=r("marker.line.outliercolor"),c="outliers";t._hasPreCompStats?c="all":(o||l)&&(c="suspectedoutliers");var u=r(i+"points",c);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function o(r,a){return n.coerce(e,t,s,r,a)}if(c(e,t,o,a),!1!==t.visible){var l=t._hasPreCompStats;l&&(o("lowerfence"),o("upperfence")),o("line.color",(e.marker||{}).color||r),o("line.width"),o("fillcolor",i.addOpacity(t.line.color,.5));var f=!1;if(l){var d=o("mean"),p=o("sd");d&&d.length&&(f=!0,p&&p.length&&(f="sd"))}o("boxmean",f),o("whiskerwidth"),o("width"),o("quartilemethod");var h=!1;if(l){var g=o("notchspan");g&&g.length&&(h=!0)}else n.validate(e.notchwidth,s.notchwidth)&&(h=!0);o("notched",h)&&o("notchwidth"),u(e,t,o,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,s,e)}for(var l=0;le.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.pos,c=t.val,u=i.bPos,f=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var p=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(e){var t=s.c2l(e.pos+u,!0),a=s.l2p(t)+f,i=s.l2p(t-o)+f,p=s.l2p(t+l)+f,h=c.c2p(e.mean,!0),g=c.c2p(e.mean-e.sd,!0),v=c.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+h+","+i+"V"+p+("sd"===d?"m0,0L"+g+","+a+"L"+h+","+i+"L"+v+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+h+"H"+p+("sd"===d?"m0,0L"+a+","+g+"L"+i+","+h+"L"+a+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":74,"../../lib":178,d3:16}],306:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,s=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],311:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:l.color,width:!1!==o.showlines?l.width:0,dash:l.dash},r._levels={start:o.start,end:i(o),size:s}}}},{"../../components/colorscale":64,"./end_plus":319,"./make_color_map":324}],312:[function(e,t,r){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],313:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,g=t.contours,v=r("contours.operation");(g._operation=c[v],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,g),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":52,"../../constants/filter_ops":156,"./label_defaults":323,"fast-isnumeric":18}],314:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":156,"fast-isnumeric":18}],315:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],316:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":178,"./constraint_mapping":314,"./end_plus":319}],319:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],320:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,g=e.z[0].length,v=t.slice(),m=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var y=d[0]&&(t[0]<0||t[0]>g-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===v[0]&&t[1]===v[1]&&d[0]===m[0]&&d[1]===m[1]||r&&y)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,L,S,C,O,z,P,D,E=i(p[0],p[p.length-1],o,s),I=0,R=.2*e.smoothing,F=[],N=0;for(c=1;c=N;c--)if((x=F[c])=N&&x+F[b]A&&L--,e.edgepaths[L]=C.concat(p,S));break}V||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r=0&&(n=y,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=m.EDGECOST*(1/(d-1)+1/(p-1));h+=m.ANGLECOST*c*c;for(var g=l-u,v=s-f,y=l+u,x=s+f,b=0;b2*m.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=m.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*f]},p=[d(-i/2,-o/2),d(-i/2,o/2),d(i/2,o/2),d(i/2,-o/2)];r.push({text:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._input.contours;if(u>f&&(r.start=d.start=f,f=r.end=d.end=u,u=r.start),!(r.size>0))c=u===f?1:i(u,f,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":178,"../../plots/cartesian/axes":222}],328:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var g;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===g&&(g=e.level),p(e.level+.5*s)})),void 0===g&&(g=c),t.selectAll("g.contourbg path").style("fill",p(g-.5*s))}})),i(e)}},{"../../components/drawing":74,"../heatmap/style":342,"./make_color_map":324,d3:16}],329:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":62,"./label_defaults":323}],330:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../components/colorscale/attributes"),l=(e("../../constants/docs").FORMAT_LINK,e("../../lib/extend").extendFlat);t.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:l({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":59,"../../constants/docs":155,"../../lib/extend":173,"../../plots/attributes":219,"../../plots/template_attributes":264,"../scatter/attributes":389}],331:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../histogram2d/calc"),l=e("../../components/colorscale/calc"),s=e("./convert_column_xyz"),c=e("./clean_2d_array"),u=e("./interp2d"),f=e("./find_empties"),d=e("./make_bound_array"),p=e("../../constants/numerical").BADNUM;function h(e){for(var t=[],r=e.length,n=0;nP){O("x scale is not linear");break}}if(m.length&&"fast"===S){var D=(m[m.length-1]-m[0])/(m.length-1),E=Math.abs(D/100);for(_=0;_E){O("y scale is not linear");break}}}var I=a.maxRowLength(b),R="scaled"===t.xtype?"":r,F=d(t,R,g,v,I,T),N="scaled"===t.ytype?"":m,B=d(t,N,y,x,b.length,k);L||(t._extremes[T._id]=i.findExtremes(T,F),t._extremes[k._id]=i.findExtremes(k,B));var H={x:F,y:B,z:b,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(R&&R.length===F.length-1&&(H.xCenter=R),N&&N.length===B.length-1&&(H.yCenter=N),A&&(H.xRanges=w.xRanges,H.yRanges=w.yRanges,H.pts=w.pts),M||l(e,t,{vals:b,cLetter:"z"}),M&&t.contours&&"heatmap"===t.contours.coloring){var j={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};H.xfill=d(j,R,g,v,I,T),H.yfill=d(j,N,y,x,b.length,k)}return[H]}},{"../../components/colorscale/calc":60,"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"../histogram2d/calc":359,"./clean_2d_array":332,"./convert_column_xyz":334,"./find_empties":336,"./interp2d":339,"./make_bound_array":340}],332:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort((function(e,t){return t[2]-e[2]}))}},{"../../lib":178}],337:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s,c){var u,f,d,p,h=e.cd[0],g=h.trace,v=e.xa,m=e.ya,y=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,k=g.zhoverformat,M=y,A=x;if(!1!==e.index){try{d=Math.round(e.index[1]),p=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(d<0||d>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(t-y[0],t-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(c){var L;for(M=[2*y[0]-y[1]],L=1;Lg&&(m=Math.max(m,Math.abs(e[i][o]-h)/(v-g))))}return m}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":178}],340:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var g=t.length;if(!(g<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)d=p.c2p(T[y]),y--;for(d0;)m=h.c2p(k[y]),y--;if(m0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&mo){var y=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(N)&&(H=o.tickIncrement(H,b.size,!0,p)),E.start=r.l2r(H),F||a.nestedProperty(t,m+".start").set(E.start)}var j=b.end,V=r.r2l(D.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(j)){var U=q?V:a.aggNums(Math.max,null,h);E.end=r.l2r(U),q||a.nestedProperty(t,m+".start").set(E.end)}var G="autobin"+l;return!1===t._input[G]&&(t._input[m]=a.extendFlat({},t[m]||{}),delete t._input[G],delete t[G]),[E,h]}t.exports={calc:function(e,t){var r,i,p,h,g=[],v=[],m=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),y="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[y],b=t[y+"calendar"],_=t.cumulative,w=d(e,t,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],z=0,P=t.histnorm,D=t.histfunc,E=-1!==P.indexOf("density");_.enabled&&E&&(P=P.replace(/ ?density$/,""),E=!1);var I,R="max"===D||"min"===D?null:0,F=s.count,N=c[P],B=!1,H=function(e){return m.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==D&&(I=t[x],B="avg"===D,F=s[D]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),$=[],J=0,K=Q-1;for(r=0;r=J;r--)if(v[r]){K=r;break}for(r=J;r<=K;r++)if(n(g[r])&&n(v[r])){var ee={p:g[r],s:v[r],b:0};_.enabled||(ee.pts=O[r],G?ee.ph0=ee.ph1=O[r].length?k[O[r][0]]:g[r]:(t._computePh=!0,ee.ph0=q(A[r]),ee.ph1=q(A[r+1],!0))),$.push(ee)}return 1===$.length&&($[0].width1=o.tickIncrement($[0].p,T.size,!1,b)-$[0].p),l($,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected($,t,Y),$},calcAllAutoBins:d}},{"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"../bar/arrays_to_calcdata":278,"./average":346,"./bin_functions":348,"./bin_label_vals":349,"./norm_functions":357,"fast-isnumeric":18}],351:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],352:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,g,v,m=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],C=[],O=[],z="string"==typeof w.size,P="string"==typeof M.size,D=[],E=[],I=z?D:w,R=P?E:M,F=0,N=[],B=[],H=t.histnorm,j=t.histfunc,V=-1!==H.indexOf("density"),q="max"===j||"min"===j?null:0,U=i.count,G=o[H],Z=!1,X=[],Y=[],W="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";W&&"count"!==j&&(Z="avg"===j,U=i[j]);var Q=w.size,$=x(w.start),J=x(w.end)+($-a.tickIncrement($,Q,!1,m))/1e6;for(r=$;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u=Math.floor((t-o.x0)/l.dx),f=Math.floor(Math.abs(r-o.y0)/l.dy);if(o.z[f][u]){var d,p=o.hi||l.hoverinfo;if(p){var h=p.split("+");-1!==h.indexOf("all")&&(h=["color"]),-1!==h.indexOf("color")&&(d=!0)}var g,v=l.colormodel,m=v.length,y=l._scaler(o.z[f][u]),x=i.colormodel[v].suffix,b=[];(l.hovertemplate||d)&&(b.push("["+[y[0]+x[0],y[1]+x[1],y[2]+x[2]].join(", ")),4===m&&b.push(", "+y[3]+x[3]),b.push("]"),b=b.join(""),e.extraText=v.toUpperCase()+": "+b),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[f])?g=l.hovertext[f][u]:Array.isArray(l.text)&&Array.isArray(l.text[f])&&(g=l.text[f][u]);var _=c.c2p(o.y0+(f+.5)*l.dy),w=o.x0+(u+.5)*l.dx,T=o.y0+(f+.5)*l.dy,k="["+o.z[f][u].slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{index:[f,u],x0:s.c2p(o.x0+u*l.dx),x1:s.c2p(o.x0+(u+1)*l.dx),y0:_,y1:_,color:y,xVal:w,xLabelVal:w,yVal:T,yLabelVal:T,zLabelVal:k,text:g,hovertemplateLabels:{zLabel:k,colorLabel:b,"color[0]Label":y[0]+x[0],"color[1]Label":y[1]+x[1],"color[2]Label":y[2]+x[2],"color[3]Label":y[3]+x[3]}})]}}}},{"../../components/fx":92,"../../lib":178,"./constants":369}],373:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":235,"./attributes":367,"./calc":368,"./defaults":370,"./event_data":371,"./hover":372,"./plot":374,"./style":375}],374:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../constants/xmlns_namespaces"),o=e("./constants");t.exports=function(e,t,r,l){var s=t.xaxis,c=t.yaxis;a.makeTraceGroups(l,r,"im").each((function(e){var t,r,l,u,f,d,p=n.select(this),h=e[0],g=h.trace,v=h.z,m=h.x0,y=h.y0,x=h.w,b=h.h,_=g.dx,w=g.dy;for(d=0;void 0===t&&d0;)r=s.c2p(m+d*_),d--;for(d=0;void 0===u&&d0;)f=c.c2p(y+d*w),d--;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":178,"../../plots/domain":249,"../bar/defaults":283,"./attributes":376,"fast-isnumeric":18}],380:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":88}],381:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:T(i,o/t),rotate:k(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:T(i,o/t),rotate:k(a+Math.PI/2)}}function T(e,t){return Math.cos(t)-e*t}function k(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),z(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===d.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}D(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:P(d.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=u+k[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),M=i.h*(T.y[1]-T.y[0]),A=(.5*k-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:T.x[0]-A,xr:T.x[1]+A,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:z,attachFxHandlers:m,computeTransform:E}},{"../../components/color":52,"../../components/drawing":74,"../../components/fx":92,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../bar/constants":281,"../bar/uniform_text":295,"./event_data":380,"./helpers":381,d3:16}],386:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":295,"./style_one":387,d3:16}],387:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":52,"./helpers":381}],388:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],396:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=P[O][1])>=G&&(E=P[O-1][0],I=P[O][0],F-R&&(D=E+(I-E)*(G-R)/(F-R),j=Math.min(j,D),V=Math.max(V,D)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":52,"../../components/fx":92,"../../lib":178,"../../registry":269,"./get_trace_color":399}],401:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":388,"./attributes":389,"./calc":390,"./cross_trace_calc":394,"./cross_trace_defaults":395,"./defaults":396,"./format_labels":398,"./hover":400,"./marker_colorbar":407,"./plot":409,"./select":410,"./style":412,"./subtypes":413}],402:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63,"../../lib":178}],403:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,z=L._length,P=S._length,D=t.connectGaps,E=t.baseTolerance,I=t.shape,R="linear"===I,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*z*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),$=null,W=Q=0}function fe(e){if(M=e[0]/z,A=e[1]/P,X=e[0]re?re:0,Y=e[1]ae?ae:0,X||Y){if(V)if($){var t=K($,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else J=K(j[V-1],e)[0],j[V++]=J;else j[V++]=[X||e[0],Y||e[1]];var r=j[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?($&&(W!==X&&Q!==Y?ce(W&&Q?(n=$,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||X,Q||Y]):W&&Q&&ce([W,Q])),ce([X,Y])):W-X&&Q-Y&&ce([X||W,Y||Q]),$=e,W=X,Q=Y}else $&&ue(K($,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===I||"spline"===I?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}$&&ce([W||$[0],Q||$[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":158,"../../lib":178,"./constants":393}],404:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],405:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":18}],407:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],408:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":52,"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63,"./subtypes":413}],409:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var z,P,D="",E=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",z).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",z),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);y(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&D?("tonext"===_.fill?y(C).attr("d",q+"Z"+D+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+D.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?$:Q:_&&!w&&(v=J),f&&(h=v),d&&(g=v)}var T,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,e),s.setClipUrl(L,Y,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function $(e){return e.filter((function(e){return e.vis}))}function J(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":74,"../../lib":178,"../../lib/polygon":190,"../../registry":269,"./line_points":403,"./link_traces":405,"./subtypes":413,d3:16}],410:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){m.push(e._hovertitle+": "+t)}}},{"../scatter/hover":400}],422:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":265,"../scatter/marker_colorbar":407,"../scatter/select":410,"../scatter/style":412,"./attributes":416,"./calc":417,"./defaults":418,"./event_data":419,"./format_labels":420,"./hover":421,"./plot":423}],423:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=t.layers.frontplot.select("g.scatterlayer");n(e,i,r,o)}},{"../scatter/plot":409}],424:[function(e,t,r){"use strict";var n=e("../box/attributes"),a=e("../../lib/extend").extendFlat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":173,"../box/attributes":296}],425:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/calc"),o=e("./helpers"),l=e("../../constants/numerical").BADNUM;function s(e,t,r){var a=t.max-t.min;if(!a)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(i,o,t.q3-t.q1),a/100)}function c(e,t,r,n){var i,o=e.spanmode,s=e.span||[],c=[t.min,t.max],u=[t.min-2*n,t.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,e[t.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}t.exports=function(e,t){var r=i(e,t);if(r[0].t.empty)return r;for(var l=e._fullLayout,u=a.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,g=0;g0){var y,x,b,_,w,T=e.xa,k=e.ya;"h"===d.orientation?(w=t,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var M=f[e.index];if(w>=M.span[0]&&w<=M.span[1]){var A=n.extendFlat({},e),L=_.c2p(w,!0),S=o.getKdeValue(M,d,w),C=o.getPositionOnKdePath(M,d,L),O=b._offset,z=b._length;A[y+"0"]=C[0],A[y+"1"]=C[1],A[x+"0"]=A[x+"1"]=L,A[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),A.spikeDistance=m[0].spikeDistance;var P=y+"Spike";A[P]=m[0][P],m[0].spikeDistance=void 0,m[0][P]=void 0,A.hovertemplate=!1,v.push(A),(u={stroke:e.color})[y+"1"]=n.constrain(O+C[0],O,O+z),u[y+"2"]=n.constrain(O+C[1],O,O+z),u[x+"1"]=u[x+"2"]=_._offset+L}}h&&(v=v.concat(m))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(e,t,r));var D=s.selectAll(".violinline-"+d.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===l?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":178,"../../plots/cartesian/axes":222,"../box/hover":301,"./helpers":428}],430:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"../box/defaults":299,"../box/select":306,"../scatter/style":412,"./attributes":424,"./calc":425,"./cross_trace_calc":426,"./defaults":427,"./hover":429,"./layout_attributes":431,"./layout_defaults":432,"./plot":433,"./style":434}],431:[function(e,t,r){"use strict";var n=e("../box/layout_attributes"),a=e("../../lib").extendFlat;t.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":178,"../box/layout_attributes":303}],432:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../box/layout_defaults");t.exports=function(e,t,r){i._supply(e,t,r,(function(r,i){return n.coerce(e,t,a,r,i)}),"violin")}},{"../../lib":178,"../box/layout_defaults":304,"./layout_attributes":431}],433:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../box/plot"),l=e("../scatter/line_points"),s=e("./helpers");t.exports=function(e,t,r,c){var u=e._fullLayout,f=t.xaxis,d=t.yaxis;function p(e){var t=l(e,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(t[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(e){var r=n.select(this),i=e[0],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,g=l.bdPos,v=t[l.valLetter+"axis"],m=t[l.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(e){var t,r,a,i,o,s,f,d,_=n.select(this),w=e.density,T=w.length,k=m.c2l(e.pos+h,!0),M=m.l2p(k);if(c.width)t=l.maxKDE/g;else{var A=u._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/g*(A.maxCount/e.pts.length):A.maxKDE/g}if(x){for(f=new Array(T),o=0;o=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],29:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[D(i(e).toString(16)),D(i(t).toString(16)),D(i(r).toString(16)),D(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function z(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function D(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],36:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],37:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":212,"../../plots/cartesian/constants":228,"../../plots/font_attributes":250,"./arrow_paths":36}],38:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":178,"../../plots/cartesian/axes":222,"./draw":43}],39:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+J]))<0||ce>1)&&(U=!0):U=!0),X=te._offset+te.r2p(t[J]),Q=.5}else"x"===J?(W=t[J],X=b.l+b.w*W):(W=1-t[J],X=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=X;var ue=t["a"+J];$=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),Y=$):(se.tail=X+ue,Y=$+ue),se.text=se.tail+$;var fe=x["x"===J?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else Y=$=ie*j(Q,oe),se.text=X+$;se.text+=le,$+=le,Y+=le,t["_"+J+"padplus"]=ie/2+Y,t["_"+J+"padminus"]=ie/2-Y,t["_"+J+"size"]=ie,t["_"+J+"shift"]=$}if(U)D.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(P-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:R+he-1,y:R+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=R+ge-h.top,me=R+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,R,R,w,P),F.call(c.setRect,E/2,E/2,I-E,H-E),D.call(c.setTranslate,Math.round(L.x.text-I/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),z=+F.attr("width"),P=+F.attr("height"),E=m-.5*z,I=E+z,R=y-.5*P,N=R+P,B=[[E,R,E,N],[E,N,I,N],[I,N,I,R],[I,R,E,R]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var X=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/X,Z+=t.standoff*(h-f)/X}var Y,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(D);Y=e.x,W=e.y,l&&l.autorange&&T(l._name+".autorange",!0),v&&v.autorange&&T(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,W),a=n[0]+e,i=n[1]+r;D.call(c.setTranslate,a,i),k("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),k("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&k("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&k("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),z)p.init({element:D.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?k("ax",l.p2r(l.r2p(t.ax)+e)):k("ax",t.ax+e),t.ayref===t.yref?k("ay",v.p2r(v.r2p(t.ay)+r)):k("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}k("x",a),k("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(D,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(D),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void z();if(m){if(m*m>x*x+b*b)return void z();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void z();var T=y*Math.cos(s),k=y*Math.sin(s);o.x-=T,o.y-=k,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":253,"../annotations/draw":43}],50:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));Z*=W*c.roundUp(Y/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+R-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,$=e.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),J=e.select("."+k.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+R-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+k.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),J.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(z);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(z[i]+z[i-1])/2,i===z.length-1?A[1]:(z[i]+z[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(D,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?P:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+D).call(d.lineGroupStyle,v.width,L(e),v.dash)})),J.selectAll("g."+G._id+"tick,path").remove();var b=H+D+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),T=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:J,path:l.makeTickPath(G,b,C),transFn:T}),l.drawLabels(r,G,{vals:w,layer:J,transFn:T,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=D+t.outlinewidth/2+d.bBox(J.node()).width;if((Q=$.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=$.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox($.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(D,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=T[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=T[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-D;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":154,"../../lib":178,"../../lib/extend":173,"../../lib/setcursor":197,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":256,"../../registry":269,"../color":52,"../colorscale/helpers":63,"../dragelement":71,"../drawing":74,"../titles":147,"./constants":54,d3:16,tinycolor2:35}],57:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":178}],58:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":53,"./defaults":55,"./draw":56,"./has_colorbar":57}],59:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":193,"../colorbar/attributes":53,"./scales.js":67}],60:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":178,"./helpers":63,"fast-isnumeric":18}],61:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],69:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":178}],70:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],71:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":178,"../../plots/cartesian/constants":228,"./align":68,"./cursor":69,"./unhover":72,"has-hover":20,"has-passive-events":21,"mouse-event-offset":24}],72:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":171,"../../lib/events":172,"../../lib/throttle":200,"../fx/constants":86}],73:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],74:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=k[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},z=0),r&&(m.savedBBoxes[r]=v),z++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",D(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(I);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":88,"../../constants/alignment":154,"../../constants/interactions":157,"../../constants/xmlns_namespaces":159,"../../lib":178,"../../lib/svg_text_utils":199,"../../registry":269,"../../traces/scatter/make_bubble_size_func":406,"../../traces/scatter/subtypes":413,"../color":52,"../colorscale":64,"./symbol_defs":75,d3:16,"fast-isnumeric":18,tinycolor2:35}],75:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:16}],76:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],77:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":413,"../drawing":74,d3:16,"fast-isnumeric":18}],82:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":52,d3:16}],83:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":173,"../../plots/font_attributes":250,"./layout_attributes":93}],84:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),I="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(I[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==Y&&0===W.length){G.distance=Y,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=Y}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!$.vLinePoint||$.vLinePoint.spikeDistance>p.spikeDistance)&&($.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!$.hLinePoint||$.hLinePoint.spikeDistance>p.spikeDistance)&&($.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&J&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:ke,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],T=w.datum;T.offset=w.dp,T.del=w.del}}}(Le,ke?"xa":"ya",u),O(Le,ke));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:I})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],T=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],z=(String(O)||"").split(" ")[0],P=p.node().getBoundingClientRect(),D=P.top,E=P.width,I=P.height,R=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(R){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-k)+",0L"+S+","+A+k+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+k+"H"+(S-2*k)+"Z")):l.attr("d","M0,0L"+k+","+A+k+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+k+"H-"+k+"Z")}else{var C,z,P;"right"===L.side?(C="start",z=1,P="",m=T._offset+T._length):(C="end",z=-1,P="-",m=T._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+P+k+","+k+"V"+(M+x.height/2)+"h"+P+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+P+k+"V-"+k+"Z");var E,I=x.height/2,R=D-x.top-I,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=J+ne>=I;return ne<=I&&(J<=D?J=L._offset+2*M:ae&&(J=I-ne)),ee.attr("transform","translate("+K+","+J+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,R,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),T=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();T=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,z,P=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=P.width+k+M+T;if(e.ty0=D-P.top,e.bx=P.width+2*M,e.by=Math.max(P.height+2*M,A),e.anchor="start",e.txwidth=P.width,e.tx2width=T,e.offset=0,l)e.pos=F,S=N+H/2+j<=I,z=N-H/2-j>=0,"top"!==e.idealAlign&&S||!z?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,z=F-B/2-j>=0,"left"!==e.idealAlign&&S||!z)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),T&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(k+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-T,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*k+d)+","+(k+p)+"v"+(e.by/2-k)+"h"+o*e.bx+"v-"+e.by+"H"+(o*k+d)+"V"+(p-k)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function P(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var z,P,D=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||D,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(z=F,P=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),z=s.t+(1-B)*s.h,P=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:z,y2:P,"stroke-width":I,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:z,y2:P,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:R}).classed("spikeline",!0)}}}function D(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":178,"../../lib/events":172,"../../lib/override_cursor":189,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":269,"../color":52,"../dragelement":71,"../drawing":74,"../legend/defaults":104,"../legend/draw":105,"./constants":86,"./helpers":88,d3:16,"fast-isnumeric":18,tinycolor2:35}],90:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":178,"../color":52,"./helpers":88}],91:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":178,"../../plot_api/plot_template":212,"../../plots/layout_attributes":254,"../../registry":269,"./attributes":102,"./helpers":108}],105:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?T(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var z=a.ensureSingle(C,"text","legendtitletext");z.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(z,C,e,t)}else C.selectAll(".legendtitletext").remove();var P=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),D=C.selectAll("g.groups").data(d);D.enter().append("g").attr("class","groups"),D.exit().remove();var E=D.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var z=0;if(s){var P=0,D=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),P=Math.max(P,t);var r=e+h;r+u+D>a._maxWidth&&(z=Math.max(z,D),D=0,E+=P+a.tracegroupgap,P=t),c.setTranslate(this,D,E),D+=r})),a._width=Math.max(z,D)+u,a._height=E+P+g}else{var I=r.size(),R=O+f+(I-1)*ha._maxWidth&&(z=Math.max(z,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(z,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,D,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,k=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-t._width),k=a.constrain(k,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,k),P.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var z=t._effHeight;t._main||(z=t._height),S.attr({width:t._width-b,height:z-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:t._width-2*b,height:z-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(P,0,0,0,0),delete t._scrollY}else{var D,E,I,R=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-R-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,R,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),R,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;D="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(I,D,E),R,B))}));P.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(D=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(I,D,E),R,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(P,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":154,"../../lib":178,"../../lib/events":172,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../../registry":269,"../color":52,"../dragelement":71,"../drawing":74,"./constants":103,"./get_legend_data":106,"./handle_click":107,"./helpers":108,"./style":110,d3:16}],106:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=f||m,k=p||v,M=w||!T?"M5,0":k?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":178,"../../registry":269,"../../traces/pie/helpers":381,"../../traces/pie/style_one":387,"../../traces/scatter/subtypes":413,"../color":52,"../colorscale/helpers":63,"../drawing":74,d3:16}],111:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=R[r+1];else if(e=n.pmax)t=R[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===D?Y:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;$(l)}};function X(r){if(m(e))D=null;else if(R)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),D=s.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),I?N("yanchor",r.yanchor=U(T+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===D){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=I?d:U(d))}else if("resize-over-end-point"===D){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=I?h:U(h))}}else{var m=function(e){return-1!==D.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),X=m("e"),Y=b?k+a:k,W=G?M+a:M,$=Z?A+n:A,J=X?L+n:L;I&&(b&&(Y=k-a),G&&(W=M-a)),(!I&&W-Y>10||I&&Y-W>10)&&(N(S,r[S]=I?Y:U(Y)),N(C,r[C]=I?W:U(W))),J-$>10&&(N(O,r[O]=E?$:q($)),N(z,r[z]=E?J:q(J)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=X}(e,E,s,t,r,D):!0===s.editable&&E.style("pointer-events",z||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),T=Math.abs(_-u),k="A"+w+","+T,M=b+w+","+_;return"M"+M+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(k=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(I),P&&(L?E.on(".opacity",null):(k=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":154,"../../constants/interactions":157,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../../registry":269,"../color":52,"../drawing":74,d3:16,"fast-isnumeric":18}],148:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":173,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":255,"../color/attributes":51}],149:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":178,"../../plots/array_container_defaults":218,"./attributes":148,"./constants":149}],151:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>T,z=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,D=h+g,E=v;D+z>s&&(D=s-z);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:D,y:E,width:z,height:P}),this._vbarYMin=E+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+z+.5:f+.5,B=d-.5,H=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+R).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":178,"../color":52,"../drawing":74,d3:16}],154:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],155:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],156:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],157:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],158:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],159:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],160:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],163:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],164:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":185}],165:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var z=v.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===M.charAt(M.length-1);M=parseInt(M,10),O=z.newDate(k,z.toMonthIndex(k,M,P),A)}else O=z.newDate(k,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,L,S));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?u:D.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,k=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":185}],177:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],178:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var T=e("./dom");function k(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return D.apply(O,arguments)};var z={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return D.apply(z,arguments)};var P=/^[:|\|]/;function D(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":158,"./anchor_utils":163,"./angles":164,"./array":165,"./clean_number":166,"./clear_responsive":168,"./coerce":169,"./dates":170,"./dom":171,"./extend":173,"./filter_unique":174,"./filter_visible":175,"./geometry2d":176,"./identity":177,"./is_plain_object":179,"./keyed_container":180,"./localize":181,"./loggers":182,"./make_trace_groups":183,"./matrix":184,"./mod":185,"./nested_property":186,"./noop":187,"./notifier":188,"./push_unique":191,"./regex":193,"./relative_attr":194,"./relink_private":195,"./search":196,"./stats":198,"./throttle":200,"./to_log_range":201,d3:16,"fast-isnumeric":18}],179:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],180:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":188}],183:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:16}],184:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],186:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":158,"./matrix":184}],191:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":165,"fast-isnumeric":18}],199:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return z(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):z(),e}function z(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],201:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":18}],202:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),z=[],P=-1,D=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?z.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(b=0;b=0;x--)C.splice(z[x],1),O&&O.splice(z[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===P)E=L;else{for(D=Math.max(C.length,D),E=[],x=0;x=P);x++)E.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),D(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&D(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in D(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=P(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),T.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof D.parts[I];)I--;var R=D.parts[I],F=D.parts[I-1]+"."+R,H=D.parts.slice(0,I).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=D.get();if(void 0!==E){k[P]=E,L[P]="reverse"===R?E:N(U);var G=f.getLayoutValObject(s,D.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(P,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(P))if(E){S("autosize",null);var $="height"===P?"width":"height";S($,s[$])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))z(F),l(s,H+"._inputRange").set(null);else if(F.match(X)){z(F),l(s,H+"._inputRange").set(null);var J=l(s,H).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else F.match(Y)&&l(s,H+"._inputDomain").set(null);if("type"===R){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete s[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var ae=l(s,P).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(P);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[P]=null:w.isRemoveVal(E)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[P]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,D.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,T.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":178,"../plots/attributes":219}],213:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,z=l.plotgroup;if(y(C,O,L)){var P=z.node(),D=l.bg=o.ensureSingle(z,"rect","bg");P.insertBefore(D.node(),P.childNodes[0]),A.push(a)}else z.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,V,q,U,G,Z,X=v._bgLayer.selectAll(".bg").data(M);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":178,"../plots/attributes":219,"../plots/plots":256,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(k);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":178,"../plots/plots":256,"../snapshot/helpers":273,"../snapshot/svgtoimg":275,"../snapshot/tosvg":277,"../version":435,"./plot_api":209,"fast-isnumeric":18}],216:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,z=Array.isArray(k);if(z&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var P=x[A].length;for(M=0;M<(z?Math.min(P,k[A].length):P);M++)L=z?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(T)if(0===d)i=[0,1];else{var z=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),P=d/(1-Math.min(.5,z/M));i=d>0?[0,P]:[P,0]}else i=k?[Math.max(0,C),Math.max(1,O)]:[C,O]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return T=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=P;a--)z(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":158,"../../lib":178,"../../registry":269,"fast-isnumeric":18}],222:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,T=e("../../constants/alignment"),k=T.MID_SHIFT,M=T.CAP_SHIFT,A=T.LINE_SPACING,L=T.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var z=e("./autorange");S.getAutoRange=z.getAutoRange,S.findExtremes=z.findExtremes;function P(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=P(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(X(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,R)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,R))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,R)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,R));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||X(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function X(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":X(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=J(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Y&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||Y&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+J(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*k},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],$);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||T)for(r=0;rD&&Rz&&(z=R);p/=(z-O)/(2*P),O=c.l2r(O),z=c.l2r(z),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:z,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function ze(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){ke="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(ke="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){ke="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":178,"fast-isnumeric":18}],240:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":154}],241:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,k=e("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,z=C.axValue,P=C.getTransform;function D(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!H){var r=Y.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&D(t,X,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&X.emit("plotly_selected",void 0);l.click(X,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:D}},{"../../components/color":52,"../../components/dragelement/helpers":70,"../../components/drawing":74,"../../components/fx":92,"../../components/fx/helpers":88,"../../components/shapes/draw_newshape/display_outlines":137,"../../components/shapes/draw_newshape/helpers":138,"../../components/shapes/draw_newshape/newshapes":139,"../../lib":178,"../../lib/clear_gl_canvases":167,"../../lib/polygon":190,"../../lib/throttle":200,"../../plot_api/subroutines":213,"../../registry":269,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:26}],242:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(e){return Math.pow(10,e)}function k(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(k(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function z(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function P(e,t,r){return n.round(r+t*e,2)}function D(e,t,r){return(e-r)/t}var E=function(t){return a(t)?P(t,e._m,e._b):p},I=function(t){return D(t,e._m,e._b)};if(e.rangebreaks){var R="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return P(t,e._m,e._b);var n=R;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?P(t,e._m2,f):0},I=function(t){var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return D(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?T:c,e.l2p=E,e.p2l=I,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return T(I(e))}:I,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=I,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return T(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=T,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return T(I(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=I,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(I(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,k=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":74,"../../lib":178,"../../registry":269,"./axes":222,d3:16}],247:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&D.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),S(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,L=h[M].r.size;if(A>_){var C=(w*A+(L-d)*_)/(A-_),O=(L*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(k)&&h[M].t){var z=h[M].t.val,P=h[M].t.size;if(z>T){var D=(k*z+(P-p)*T)/(z-T),E=(P*(1-T)+(k-p)*(1-z))/(z-T);D>=0&&E>=0&&p-(E+D)>0&&D+E>f+u&&(f=D,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(P(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var z=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),C[2]||(C[2]=z);var P=n.range.apply(this,C);if(P=P.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=n.select(E)}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 I,R=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+X(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var $=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=X(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&$.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var J=n.max(R.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));I.attr({transform:"translate("+[x+J,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!k){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":154,"../../../lib":178,d3:16}],261:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":52,"../../../lib":178,"./micropolar":260,"./undo_manager":262,d3:16}],262:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a=u&&(p.min=0,g.min=0,v.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function h(e,t,r,n){var a=f[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=t._name.charAt(0).toUpperCase(),g="Component "+h,v=o("title.text",g);t._hovertitle=v===g?v:h,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear",{}),s(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:f,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":52,"../../lib":178,"../../plot_api/plot_template":212,"../cartesian/line_grid_defaults":238,"../cartesian/tick_label_defaults":243,"../cartesian/tick_mark_defaults":244,"../cartesian/tick_value_defaults":245,"../subplot_defaults":263,"./layout_attributes":266}],268:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o._,s=e("../../components/color"),c=e("../../components/drawing"),u=e("../cartesian/set_convert"),f=e("../../lib/extend").extendFlat,d=e("../plots"),p=e("../cartesian/axes"),h=e("../../components/dragelement"),g=e("../../components/fx"),v=e("../../components/dragelement/helpers"),m=v.freeMode,y=v.rectMode,x=e("../../components/titles"),b=e("../cartesian/select").prepSelect,_=e("../cartesian/select").selectOnClick,w=e("../cartesian/select").clearSelect,T=e("../cartesian/select").clearSelectionsCache,k=e("../cartesian/constants");function M(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=M;var A=M.prototype;A.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},A.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aL*x?a=(i=x)*L:i=(a=y)/L,o=v*a/y,l=m*i/x,r=t.l+t.w*h-a/2,n=t.t+t.h*(1-g)-i/2,d.x0=r,d.y0=n,d.w=a,d.h=i,d.sum=b,d.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[h-o/2,h+o/2],_id:"x"},u(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(e){return e.a>=d.aaxis.range[0]&&e.a<=d.aaxis.range[1]&&e.b>=d.baxis.range[1]&&e.b<=d.baxis.range[0]&&e.c>=d.caxis.range[1]&&e.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[_,b-w-T],domain:[g-l/2,g+l/2],_id:"y"},u(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var k=d.yaxis.domain[0],M=d.aaxis=f({},e.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+l*L],anchor:"free",position:0,_id:"y",_length:a});u(M,d.graphDiv._fullLayout),M.setScale();var A=d.baxis=f({},e.baxis,{range:[b-_-T,w],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(A,d.graphDiv._fullLayout),A.setScale();var S=d.caxis=f({},e.caxis,{range:[b-_-w,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+l*L],anchor:"free",position:0,_id:"y",_length:a});u(S,d.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDef.select("path").attr("d",C),d.layers.plotbg.select("path").attr("d",C);var O="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";d.clipDefRelative.select("path").attr("d",O);var z="translate("+r+","+n+")";d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),d.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-A._offset)+","+(n+i)+")";d.layers.baxis.attr("transform",P),d.layers.bgrid.attr("transform",P);var D="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-M._offset+")";d.layers.aaxis.attr("transform",D),d.layers.agrid.attr("transform",D);var E="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";d.layers.caxis.attr("transform",E),d.layers.cgrid.attr("transform",E),d.drawAxes(!0),d.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(s.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(s.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",S.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(s.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),c.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},A.drawAxes=function(e){var t=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),e){var s=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=x.draw(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:l(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=x.draw(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:l(t,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},A.drawAx=function(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=p.calcTicks(e),f=p.clipEnds(e,u),d=p.makeTransFn(e),h=p.getTickSigns(e)[2],g=o.deg2rad(30),v=h*(e.linewidth||1)/2,m=h*e.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+v+"l"+Math.sin(g)*m+","+Math.cos(g)*m:"M"+v+",0l"+Math.cos(g)*m+","+-Math.sin(g)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];p.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),p.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),p.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:p.makeLabelFns(e,0,30)})};var S=k.MINZOOM/2+.87,C="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(.87*S+4.5)+"l2.6,1.5l-"+S/2+","+.87*S+"Z",O="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-2.6,1.5l"+S/2+","+.87*S+"Z",z="m0,1l"+S/2+","+.87*S+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(.87*S+4.5)+"l-"+(S/2+2.6)+","+(.87*S+4.5)+"l2.6,1.5l"+S/2+",-"+.87*S+"Z",P=!0;function D(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}A.clearSelect=function(){T(this.dragOptions),w(this.dragOptions.gd)},A.initInteractions=function(){var e,t,r,n,u,f,d,p,v,x,w=this,T=w.layers.plotbg.select("path").node(),M=w.graphDiv,A=M._fullLayout._zoomlayer;function S(e){var t={};return t[w.id+".aaxis.min"]=e.a,t[w.id+".baxis.min"]=e.b,t[w.id+".caxis.min"]=e.c,t}function E(e,t){var r=M._fullLayout.clickmode;D(M),2===e&&(M.emit("plotly_doubleclick",null),i.call("_guiRelayout",M,S({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&_(t,M,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&g.click(M,t,w.id)}function I(e,t){return 1-t/w.h}function R(e,t){return 1-(e+(w.h-t)/Math.sqrt(3))/w.w}function F(e,t){return(e-(w.h-t)/Math.sqrt(3))/w.w}function N(a,i){var o=e+a,l=t+i,s=Math.max(0,Math.min(1,I(0,t),I(0,l))),c=Math.max(0,Math.min(1,R(e,t),R(o,l))),h=Math.max(0,Math.min(1,F(e,t),F(o,l))),g=(s/2+h)*w.w,m=(1-s/2-c)*w.w,y=(g+m)/2,b=m-g,_=(1-s)*w.h,T=_-b/L;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),x.transition().style("opacity",1).duration(200),p=!0),M.emit("plotly_relayouting",S(u))}function B(){D(M),u!==r&&(i.call("_guiRelayout",M,S(u)),P&&M.data&&M._context.showTips&&(o.notifier(l(M,"Double-click to zoom back out"),"long"),P=!1))}function H(e,t){var n=e/w.xaxis._m,a=t/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),l=i.indexOf(u.b),s=i.indexOf(u.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),u={a:i[o],b:i[l],c:i[s]},t=(r.a-u.a)*w.yaxis._m,e=(r.c-u.c-r.b+u.b)*w.xaxis._m);var f="translate("+(w.x0+e)+","+(w.y0+t)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d="translate("+-e+","+-t+")";w.clipDefRelative.select("path").attr("transform",d),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),M.emit("plotly_relayouting",S(u))}function j(){i.call("_guiRelayout",M,S(u))}this.dragOptions={element:T,gd:M,plotinfo:{id:w.id,domain:M._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,l){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis];var c=w.dragOptions.dragmode=M._fullLayout.dragmode;m(c)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===c?(w.dragOptions.moveFn=N,w.dragOptions.clickFn=E,w.dragOptions.doneFn=B,function(i,o,l){var c=T.getBoundingClientRect();e=o-c.left,t=l-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,f=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),d="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,v=A.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",d),x=A.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearSelect(M)}(0,o,l)):"pan"===c?(w.dragOptions.moveFn=H,w.dragOptions.clickFn=E,w.dragOptions.doneFn=j,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,w.clearSelect(M)):(y(c)||m(c))&&b(i,o,l,w.dragOptions,c)}},T.onmousemove=function(e){g.hover(M,e,w.id),M._fullLayout._lasthover=T,M._fullLayout._hoversubplot=w.id},T.onmouseout=function(e){M._dragging||h.unhover(M,e)},h.init(this.dragOptions)}},{"../../components/color":52,"../../components/dragelement":71,"../../components/dragelement/helpers":70,"../../components/drawing":74,"../../components/fx":92,"../../components/titles":147,"../../lib":178,"../../lib/extend":173,"../../registry":269,"../cartesian/axes":222,"../cartesian/constants":228,"../cartesian/select":241,"../cartesian/set_convert":242,"../plots":256,d3:16,tinycolor2:35}],269:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in m(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":52,"../components/drawing":74,"../constants/xmlns_namespaces":159,"../lib":178,d3:16}],278:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(T=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var z=g[e.index],P=v.base?z.b+z.s:z.s;e[f+"0"]=e[f+"1"]=C.c2p(z[f],!0),e[f+"LabelVal"]=P;var D=m.extents[m.extents.round(z.p)];return e[u+"0"]=S.c2p(y?T(z):D[0],!0),e[u+"1"]=S.c2p(y?k(z):D[1],!0),e[u+"LabelVal"]=z.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(z)+function(e){return M(_(e),w(e))}(z))/2-b,e[u+"Spike"]=S.c2p(z.p,!0),o(z,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":52,"../../components/fx":92,"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"./helpers":285}],287:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":235,"../scatter/marker_colorbar":407,"./arrays_to_calcdata":278,"./attributes":279,"./calc":280,"./cross_trace_calc":282,"./defaults":283,"./event_data":284,"./hover":286,"./layout_attributes":288,"./layout_defaults":289,"./plot":290,"./select":291,"./style":293}],288:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],289:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,I),B=G(B,N,I),H=G(H,j,!I),j=G(j,H,!I)}var Z=M(i.ensureSingle(P,"path"),z,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!z.uniformtext.mode&&R){var X=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,X,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function z(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,D="h"===P.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(P,a);var I="stack"===v.mode||"relative"===v.mode,R=n[a],F=!I||R._outmost;if(!E||"none"===w||(R.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,N,B),j=h.getOutsideTextFont(P,a,N),V=r.datum();D?"log"===T.type&&V.s0<=0&&(l=T.range[0]=G*(W/Z):W>=Z*(Y/G);G>0&&Z>0&&(Q||$||J)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){X=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=z(r,E,X)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,M=0,A=l?k(t,e):k(r,n);l?(b=t-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:D,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=C(l,c,f,p,U,{isHorizontal:D,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=X.size,d(P.type,ee,O),R.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,v)},toMoveInsideBar:C}},{"../../components/color":52,"../../components/drawing":74,"../../components/fx/helpers":88,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":269,"./attributes":279,"./constants":281,"./helpers":285,"./style":293,"./uniform_text":295,d3:16,"fast-isnumeric":18}],291:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":52,"../../components/drawing":74,"../../lib":178,"../../registry":269,"./attributes":279,"./helpers":285,"./uniform_text":295,d3:16}],294:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":52,"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63}],295:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oA.uf};if(t._hasPreCompStats){var F=t[y],N=function(e){return m.d2c((t[e]||[])[r])},B=1/0,H=-1/0;for(r=0;r=A.q1&&A.q3>=A.med){var V=N("lowerfence");A.lf=V!==o&&V<=A.q1?V:d(A,S,C);var q=N("upperfence");A.uf=q!==o&&q>=A.q3?q:p(A,S,C);var U=N("mean");A.mean=U!==o?U:C?i.mean(S,C):(A.q1+A.q3)/2;var G=N("sd");A.sd=U!==o&&G>=0?G:C?i.stdev(S,C,A.mean):A.q3-A.q1,A.lo=h(A),A.uo=g(A);var Z=N("notchspan");Z=Z!==o&&Z>0?Z:v(A,C),A.ln=A.med-Z,A.un=A.med+Z;var X=A.lf,Y=A.uf;t.boxpoints&&S.length&&(X=Math.min(X,S[0]),Y=Math.max(Y,S[C-1])),t.notched&&(X=Math.min(X,A.ln),Y=Math.max(Y,A.un)),A.min=X,A.max=Y}else{var W;i.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+A.q1,"median = "+A.med,"q3 = "+A.q3].join("\n")),W=A.med!==o?A.med:A.q1!==o?A.q3!==o?(A.q1+A.q3)/2:A.q1:A.q3!==o?A.q3:0,A.med=W,A.q1=A.q3=W,A.lf=A.uf=W,A.mean=A.sd=W,A.ln=A.un=W,A.min=A.max=W}B=Math.min(B,A.min),H=Math.max(H,A.max),A.pts2=L.filter(R),k.push(A)}}t._extremes[m._id]=a.findExtremes(m,[B,H],{padded:!0})}else{var Q=m.makeCalcdata(t,y),$=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ee0){var oe,le;if((A={}).pos=A[b]=E[r],L=A.pts=K[r].sort(u),C=(S=A[y]=L.map(f)).length,A.min=S[0],A.max=S[C-1],A.mean=i.mean(S,C),A.sd=i.stdev(S,C,A.mean),A.med=i.interp(S,.5),C%2&&(ae||ie))ae?(oe=S.slice(0,C/2),le=S.slice(C/2+1)):ie&&(oe=S.slice(0,C/2+1),le=S.slice(C/2)),A.q1=i.interp(oe,.5),A.q3=i.interp(le,.5);else A.q1=i.interp(S,.25),A.q3=i.interp(S,.75);A.lf=d(A,S,C),A.uf=p(A,S,C),A.lo=h(A),A.uo=g(A);var se=v(A,C);A.ln=A.med-se,A.un=A.med+se,te=Math.min(te,A.ln),re=Math.max(re,A.un),A.pts2=L.filter(R),k.push(A)}t._extremes[m._id]=a.findExtremes(m,t.notched?Q.concat([te,re]):Q,{padded:!0})}return function(e,t){if(i.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(k[0].t={num:_[M],dPos:I,posLetter:b,valLetter:y,labels:{med:l(e,"median:"),min:l(e,"min:"),q1:l(e,"q1:"),q3:l(e,"q3:"),max:l(e,"max:"),mean:"sd"===t.boxmean?l(e,"mean \xb1 \u03c3:"):l(e,"mean:"),lf:l(e,"lower fence:"),uf:l(e,"upper fence:")}},_[M]++,k):[{t:{empty:!0}}]};var s={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in s)i.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?i.isArrayOrTypedArray(t[n][r[0]])&&(e[s[n]]=t[n][r[0]][r[1]]):e[s[n]]=t[n][r])}function u(e,t){return e.v-t.v}function f(e){return e.v}function d(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(i.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function p(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(i.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function h(e){return 4*e.q1-3*e.q3}function g(e){return 4*e.q3-3*e.q1}function v(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"fast-isnumeric":18}],298:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],g=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var U=S.pointpos,G=S.jitter,Z=S.marker.size/2,X=0;U+G>=0&&((X=V*(U+G))>A?(q=!0,H=Z,N=X):X>R&&(H=Z,N=A)),X<=A&&(N=A);var Y=0;U-G<=0&&((Y=-V*(U-G))>L?(q=!0,j=Z,B=Y):Y>F&&(j=Z,B=L)),Y<=L&&(B=L)}else N=A,B=L;var W=new Array(c.length);for(s=0;s0?(v="v",m=x>0?Math.min(_,b):Math.min(b)):x>0?(v="h",m=Math.min(_)):m=0;if(m){t._length=m;var M=r("orientation",v);t._hasPreCompStats?"v"===M&&0===x?(r("x0",0),r("dx",1)):"h"===M&&0===y&&(r("y0",0),r("dy",1)):"v"===M&&0===x?r("x0"):"h"===M&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function u(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,s,"marker.outliercolor"),l=r("marker.line.outliercolor"),c="outliers";t._hasPreCompStats?c="all":(o||l)&&(c="suspectedoutliers");var u=r(i+"points",c);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function o(r,a){return n.coerce(e,t,s,r,a)}if(c(e,t,o,a),!1!==t.visible){var l=t._hasPreCompStats;l&&(o("lowerfence"),o("upperfence")),o("line.color",(e.marker||{}).color||r),o("line.width"),o("fillcolor",i.addOpacity(t.line.color,.5));var f=!1;if(l){var d=o("mean"),p=o("sd");d&&d.length&&(f=!0,p&&p.length&&(f="sd"))}o("boxmean",f),o("whiskerwidth"),o("width"),o("quartilemethod");var h=!1;if(l){var g=o("notchspan");g&&g.length&&(h=!0)}else n.validate(e.notchwidth,s.notchwidth)&&(h=!0);o("notched",h)&&o("notchwidth"),u(e,t,o,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,s,e)}for(var l=0;le.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.pos,c=t.val,u=i.bPos,f=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var p=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(e){var t=s.c2l(e.pos+u,!0),a=s.l2p(t)+f,i=s.l2p(t-o)+f,p=s.l2p(t+l)+f,h=c.c2p(e.mean,!0),g=c.c2p(e.mean-e.sd,!0),v=c.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+h+","+i+"V"+p+("sd"===d?"m0,0L"+g+","+a+"L"+h+","+i+"L"+v+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+h+"H"+p+("sd"===d?"m0,0L"+a+","+g+"L"+i+","+h+"L"+a+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":74,"../../lib":178,d3:16}],306:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,s=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],311:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:l.color,width:!1!==o.showlines?l.width:0,dash:l.dash},r._levels={start:o.start,end:i(o),size:s}}}},{"../../components/colorscale":64,"./end_plus":319,"./make_color_map":324}],312:[function(e,t,r){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],313:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,g=t.contours,v=r("contours.operation");(g._operation=c[v],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,g),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":52,"../../constants/filter_ops":156,"./label_defaults":323,"fast-isnumeric":18}],314:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":156,"fast-isnumeric":18}],315:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],316:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":178,"./constraint_mapping":314,"./end_plus":319}],319:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],320:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,g=e.z[0].length,v=t.slice(),m=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var y=d[0]&&(t[0]<0||t[0]>g-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===v[0]&&t[1]===v[1]&&d[0]===m[0]&&d[1]===m[1]||r&&y)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,L,S,C,O,z,P,D,E=i(p[0],p[p.length-1],o,s),I=0,R=.2*e.smoothing,F=[],N=0;for(c=1;c=N;c--)if((x=F[c])=N&&x+F[b]A&&L--,e.edgepaths[L]=C.concat(p,S));break}V||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r=0&&(n=y,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=m.EDGECOST*(1/(d-1)+1/(p-1));h+=m.ANGLECOST*c*c;for(var g=l-u,v=s-f,y=l+u,x=s+f,b=0;b2*m.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=m.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*f]},p=[d(-i/2,-o/2),d(-i/2,o/2),d(i/2,o/2),d(i/2,-o/2)];r.push({text:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._input.contours;if(u>f&&(r.start=d.start=f,f=r.end=d.end=u,u=r.start),!(r.size>0))c=u===f?1:i(u,f,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":178,"../../plots/cartesian/axes":222}],328:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var g;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===g&&(g=e.level),p(e.level+.5*s)})),void 0===g&&(g=c),t.selectAll("g.contourbg path").style("fill",p(g-.5*s))}})),i(e)}},{"../../components/drawing":74,"../heatmap/style":342,"./make_color_map":324,d3:16}],329:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":62,"./label_defaults":323}],330:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../components/colorscale/attributes"),l=(e("../../constants/docs").FORMAT_LINK,e("../../lib/extend").extendFlat);t.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:l({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":59,"../../constants/docs":155,"../../lib/extend":173,"../../plots/attributes":219,"../../plots/template_attributes":264,"../scatter/attributes":389}],331:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../histogram2d/calc"),l=e("../../components/colorscale/calc"),s=e("./convert_column_xyz"),c=e("./clean_2d_array"),u=e("./interp2d"),f=e("./find_empties"),d=e("./make_bound_array"),p=e("../../constants/numerical").BADNUM;function h(e){for(var t=[],r=e.length,n=0;nP){O("x scale is not linear");break}}if(m.length&&"fast"===S){var D=(m[m.length-1]-m[0])/(m.length-1),E=Math.abs(D/100);for(_=0;_E){O("y scale is not linear");break}}}var I=a.maxRowLength(b),R="scaled"===t.xtype?"":r,F=d(t,R,g,v,I,T),N="scaled"===t.ytype?"":m,B=d(t,N,y,x,b.length,k);L||(t._extremes[T._id]=i.findExtremes(T,F),t._extremes[k._id]=i.findExtremes(k,B));var H={x:F,y:B,z:b,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(R&&R.length===F.length-1&&(H.xCenter=R),N&&N.length===B.length-1&&(H.yCenter=N),A&&(H.xRanges=w.xRanges,H.yRanges=w.yRanges,H.pts=w.pts),M||l(e,t,{vals:b,cLetter:"z"}),M&&t.contours&&"heatmap"===t.contours.coloring){var j={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};H.xfill=d(j,R,g,v,I,T),H.yfill=d(j,N,y,x,b.length,k)}return[H]}},{"../../components/colorscale/calc":60,"../../constants/numerical":158,"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"../histogram2d/calc":359,"./clean_2d_array":332,"./convert_column_xyz":334,"./find_empties":336,"./interp2d":339,"./make_bound_array":340}],332:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort((function(e,t){return t[2]-e[2]}))}},{"../../lib":178}],337:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s,c){var u,f,d,p,h=e.cd[0],g=h.trace,v=e.xa,m=e.ya,y=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,k=g.zhoverformat,M=y,A=x;if(!1!==e.index){try{d=Math.round(e.index[1]),p=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(d<0||d>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(t-y[0],t-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(c){var L;for(M=[2*y[0]-y[1]],L=1;Lg&&(m=Math.max(m,Math.abs(e[i][o]-h)/(v-g))))}return m}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":178}],340:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var g=t.length;if(!(g<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)d=p.c2p(T[y]),y--;for(d0;)m=h.c2p(k[y]),y--;if(m0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&mo){var y=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(N)&&(H=o.tickIncrement(H,b.size,!0,p)),E.start=r.l2r(H),F||a.nestedProperty(t,m+".start").set(E.start)}var j=b.end,V=r.r2l(D.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(j)){var U=q?V:a.aggNums(Math.max,null,h);E.end=r.l2r(U),q||a.nestedProperty(t,m+".start").set(E.end)}var G="autobin"+l;return!1===t._input[G]&&(t._input[m]=a.extendFlat({},t[m]||{}),delete t._input[G],delete t[G]),[E,h]}t.exports={calc:function(e,t){var r,i,p,h,g=[],v=[],m=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),y="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[y],b=t[y+"calendar"],_=t.cumulative,w=d(e,t,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],z=0,P=t.histnorm,D=t.histfunc,E=-1!==P.indexOf("density");_.enabled&&E&&(P=P.replace(/ ?density$/,""),E=!1);var I,R="max"===D||"min"===D?null:0,F=s.count,N=c[P],B=!1,H=function(e){return m.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==D&&(I=t[x],B="avg"===D,F=s[D]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),$=[],J=0,K=Q-1;for(r=0;r=J;r--)if(v[r]){K=r;break}for(r=J;r<=K;r++)if(n(g[r])&&n(v[r])){var ee={p:g[r],s:v[r],b:0};_.enabled||(ee.pts=O[r],G?ee.ph0=ee.ph1=O[r].length?k[O[r][0]]:g[r]:(t._computePh=!0,ee.ph0=q(A[r]),ee.ph1=q(A[r+1],!0))),$.push(ee)}return 1===$.length&&($[0].width1=o.tickIncrement($[0].p,T.size,!1,b)-$[0].p),l($,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected($,t,Y),$},calcAllAutoBins:d}},{"../../lib":178,"../../plots/cartesian/axes":222,"../../registry":269,"../bar/arrays_to_calcdata":278,"./average":346,"./bin_functions":348,"./bin_label_vals":349,"./norm_functions":357,"fast-isnumeric":18}],351:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],352:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,g,v,m=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],C=[],O=[],z="string"==typeof w.size,P="string"==typeof M.size,D=[],E=[],I=z?D:w,R=P?E:M,F=0,N=[],B=[],H=t.histnorm,j=t.histfunc,V=-1!==H.indexOf("density"),q="max"===j||"min"===j?null:0,U=i.count,G=o[H],Z=!1,X=[],Y=[],W="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";W&&"count"!==j&&(Z="avg"===j,U=i[j]);var Q=w.size,$=x(w.start),J=x(w.end)+($-a.tickIncrement($,Q,!1,m))/1e6;for(r=$;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u=Math.floor((t-o.x0)/l.dx),f=Math.floor(Math.abs(r-o.y0)/l.dy);if(o.z[f][u]){var d,p=o.hi||l.hoverinfo;if(p){var h=p.split("+");-1!==h.indexOf("all")&&(h=["color"]),-1!==h.indexOf("color")&&(d=!0)}var g,v=l.colormodel,m=v.length,y=l._scaler(o.z[f][u]),x=i.colormodel[v].suffix,b=[];(l.hovertemplate||d)&&(b.push("["+[y[0]+x[0],y[1]+x[1],y[2]+x[2]].join(", ")),4===m&&b.push(", "+y[3]+x[3]),b.push("]"),b=b.join(""),e.extraText=v.toUpperCase()+": "+b),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[f])?g=l.hovertext[f][u]:Array.isArray(l.text)&&Array.isArray(l.text[f])&&(g=l.text[f][u]);var _=c.c2p(o.y0+(f+.5)*l.dy),w=o.x0+(u+.5)*l.dx,T=o.y0+(f+.5)*l.dy,k="["+o.z[f][u].slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{index:[f,u],x0:s.c2p(o.x0+u*l.dx),x1:s.c2p(o.x0+(u+1)*l.dx),y0:_,y1:_,color:y,xVal:w,xLabelVal:w,yVal:T,yLabelVal:T,zLabelVal:k,text:g,hovertemplateLabels:{zLabel:k,colorLabel:b,"color[0]Label":y[0]+x[0],"color[1]Label":y[1]+x[1],"color[2]Label":y[2]+x[2],"color[3]Label":y[3]+x[3]}})]}}}},{"../../components/fx":92,"../../lib":178,"./constants":369}],373:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":235,"./attributes":367,"./calc":368,"./defaults":370,"./event_data":371,"./hover":372,"./plot":374,"./style":375}],374:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../constants/xmlns_namespaces"),o=e("./constants");t.exports=function(e,t,r,l){var s=t.xaxis,c=t.yaxis;a.makeTraceGroups(l,r,"im").each((function(e){var t,r,l,u,f,d,p=n.select(this),h=e[0],g=h.trace,v=h.z,m=h.x0,y=h.y0,x=h.w,b=h.h,_=g.dx,w=g.dy;for(d=0;void 0===t&&d0;)r=s.c2p(m+d*_),d--;for(d=0;void 0===u&&d0;)f=c.c2p(y+d*w),d--;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":178,"../../plots/domain":249,"../bar/defaults":283,"./attributes":376,"fast-isnumeric":18}],380:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":88}],381:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:T(i,o/t),rotate:k(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:T(i,o/t),rotate:k(a+Math.PI/2)}}function T(e,t){return Math.cos(t)-e*t}function k(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),z(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===d.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}D(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:P(d.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=u+k[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),M=i.h*(T.y[1]-T.y[0]),A=(.5*k-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:T.x[0]-A,xr:T.x[1]+A,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:z,attachFxHandlers:m,computeTransform:E}},{"../../components/color":52,"../../components/drawing":74,"../../components/fx":92,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":256,"../bar/constants":281,"../bar/uniform_text":295,"./event_data":380,"./helpers":381,d3:16}],386:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":295,"./style_one":387,d3:16}],387:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":52,"./helpers":381}],388:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],396:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=P[O][1])>=G&&(E=P[O-1][0],I=P[O][0],F-R&&(D=E+(I-E)*(G-R)/(F-R),j=Math.min(j,D),V=Math.max(V,D)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":52,"../../components/fx":92,"../../lib":178,"../../registry":269,"./get_trace_color":399}],401:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":388,"./attributes":389,"./calc":390,"./cross_trace_calc":394,"./cross_trace_defaults":395,"./defaults":396,"./format_labels":398,"./hover":400,"./marker_colorbar":407,"./plot":409,"./select":410,"./style":412,"./subtypes":413}],402:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63,"../../lib":178}],403:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,z=L._length,P=S._length,D=t.connectGaps,E=t.baseTolerance,I=t.shape,R="linear"===I,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*z*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),$=null,W=Q=0}function fe(e){if(M=e[0]/z,A=e[1]/P,X=e[0]re?re:0,Y=e[1]ae?ae:0,X||Y){if(V)if($){var t=K($,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else J=K(j[V-1],e)[0],j[V++]=J;else j[V++]=[X||e[0],Y||e[1]];var r=j[V-1];X&&Y&&(r[0]!==X||r[1]!==Y)?($&&(W!==X&&Q!==Y?ce(W&&Q?(n=$,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||X,Q||Y]):W&&Q&&ce([W,Q])),ce([X,Y])):W-X&&Q-Y&&ce([X||W,Y||Q]),$=e,W=X,Q=Y}else $&&ue(K($,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===I||"spline"===I?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}$&&ce([W||$[0],Q||$[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":158,"../../lib":178,"./constants":393}],404:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],405:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":18}],407:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],408:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":52,"../../components/colorscale/defaults":62,"../../components/colorscale/helpers":63,"./subtypes":413}],409:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var z,P,D="",E=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",z).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",z),s.singleLineStyle(f,a)}}}}}var X=M.selectAll(".js-line").data(G);y(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(X,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&D?("tonext"===_.fill?y(C).attr("d",q+"Z"+D+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+D.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?$:Q:_&&!w&&(v=J),f&&(h=v),d&&(g=v)}var T,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var Y=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,Y,e),s.setClipUrl(L,Y,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function $(e){return e.filter((function(e){return e.vis}))}function J(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":74,"../../lib":178,"../../lib/polygon":190,"../../registry":269,"./line_points":403,"./link_traces":405,"./subtypes":413,d3:16}],410:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){m.push(e._hovertitle+": "+t)}}},{"../scatter/hover":400}],422:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":265,"../scatter/marker_colorbar":407,"../scatter/select":410,"../scatter/style":412,"./attributes":416,"./calc":417,"./defaults":418,"./event_data":419,"./format_labels":420,"./hover":421,"./plot":423}],423:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=t.layers.frontplot.select("g.scatterlayer");n(e,i,r,o)}},{"../scatter/plot":409}],424:[function(e,t,r){"use strict";var n=e("../box/attributes"),a=e("../../lib/extend").extendFlat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":173,"../box/attributes":296}],425:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/calc"),o=e("./helpers"),l=e("../../constants/numerical").BADNUM;function s(e,t,r){var a=t.max-t.min;if(!a)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(i,o,t.q3-t.q1),a/100)}function c(e,t,r,n){var i,o=e.spanmode,s=e.span||[],c=[t.min,t.max],u=[t.min-2*n,t.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,e[t.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}t.exports=function(e,t){var r=i(e,t);if(r[0].t.empty)return r;for(var l=e._fullLayout,u=a.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,g=0;g0){var y,x,b,_,w,T=e.xa,k=e.ya;"h"===d.orientation?(w=t,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var M=f[e.index];if(w>=M.span[0]&&w<=M.span[1]){var A=n.extendFlat({},e),L=_.c2p(w,!0),S=o.getKdeValue(M,d,w),C=o.getPositionOnKdePath(M,d,L),O=b._offset,z=b._length;A[y+"0"]=C[0],A[y+"1"]=C[1],A[x+"0"]=A[x+"1"]=L,A[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),A.spikeDistance=m[0].spikeDistance;var P=y+"Spike";A[P]=m[0][P],m[0].spikeDistance=void 0,m[0][P]=void 0,A.hovertemplate=!1,v.push(A),(u={stroke:e.color})[y+"1"]=n.constrain(O+C[0],O,O+z),u[y+"2"]=n.constrain(O+C[1],O,O+z),u[x+"1"]=u[x+"2"]=_._offset+L}}h&&(v=v.concat(m))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(e,t,r));var D=s.selectAll(".violinline-"+d.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===l?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":178,"../../plots/cartesian/axes":222,"../box/hover":301,"./helpers":428}],430:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"../box/defaults":299,"../box/select":306,"../scatter/style":412,"./attributes":424,"./calc":425,"./cross_trace_calc":426,"./defaults":427,"./hover":429,"./layout_attributes":431,"./layout_defaults":432,"./plot":433,"./style":434}],431:[function(e,t,r){"use strict";var n=e("../box/layout_attributes"),a=e("../../lib").extendFlat;t.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":178,"../box/layout_attributes":303}],432:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../box/layout_defaults");t.exports=function(e,t,r){i._supply(e,t,r,(function(r,i){return n.coerce(e,t,a,r,i)}),"violin")}},{"../../lib":178,"../box/layout_defaults":304,"./layout_attributes":431}],433:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../box/plot"),l=e("../scatter/line_points"),s=e("./helpers");t.exports=function(e,t,r,c){var u=e._fullLayout,f=t.xaxis,d=t.yaxis;function p(e){var t=l(e,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(t[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(e){var r=n.select(this),i=e[0],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,g=l.bdPos,v=t[l.valLetter+"axis"],m=t[l.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(e){var t,r,a,i,o,s,f,d,_=n.select(this),w=e.density,T=w.length,k=m.c2l(e.pos+h,!0),M=m.l2p(k);if(c.width)t=l.maxKDE/g;else{var A=u._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/g*(A.maxCount/e.pts.length):A.maxKDE/g}if(x){for(f=new Array(T),o=0;o 0) { var factor = 1 - 2 * frameMargins; @@ -85801,7 +85810,7 @@ module.exports = { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[8])(8) }); diff --git a/dist/plotly-finance.min.js b/dist/plotly-finance.min.js index 3a9c524fab4..81418a0c9d8 100644 --- a/dist/plotly-finance.min.js +++ b/dist/plotly-finance.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (finance - minified) v1.54.2 +* plotly.js (finance - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -18,4 +18,4 @@ * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":25,"./lib/epsilon":26,"./lib/geojson":27,"./lib/intersecter":28,"./lib/segment-chainer":30,"./lib/segment-selector":31}],25:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],26:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],27:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return D(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],34:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],35:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":210,"../../plots/cartesian/constants":226,"../../plots/font_attributes":248,"./arrow_paths":34}],36:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":176,"../../plots/cartesian/axes":220,"./draw":41}],37:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(U=!0):U=!0),Y=te._offset+te.r2p(t[$]),Q=.5}else"x"===$?(W=t[$],Y=b.l+b.w*W):(W=1-t[$],Y=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+$];J=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=J):(se.tail=Y+ue,X=J+ue),se.text=se.tail+J;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=J=ie*j(Q,oe),se.text=Y+J;se.text+=le,J+=le,X+=le,t["_"+$+"padplus"]=ie/2+X,t["_"+$+"padminus"]=ie/2-X,t["_"+$+"size"]=ie,t["_"+$+"shift"]=J}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:R+he-1,y:R+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=R+ge-h.top,me=R+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,R,R,w,D),F.call(c.setRect,E/2,E/2,I-E,H-E),z.call(c.setTranslate,Math.round(L.x.text-I/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),E=m-.5*P,I=E+P,R=y-.5*D,N=R+D,B=[[E,R,E,N],[E,N,I,N],[I,N,I,R],[I,R,E,R]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&T(l._name+".autorange",!0),v&&v.autorange&&T(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),k("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),k("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&k("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&k("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),P)p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?k("ax",l.p2r(l.r2p(t.ax)+e)):k("ax",t.ax+e),t.ayref===t.yref?k("ay",v.p2r(v.r2p(t.ay)+r)):k("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}k("x",a),k("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var T=y*Math.cos(s),k=y*Math.sin(s);o.x-=T,o.y-=k,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":251,"../annotations/draw":41}],48:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+R-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,J=e.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+k.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+R-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+k.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(P);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=H+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),T=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:$,path:l.makeTickPath(G,b,C),transFn:T}),l.drawLabels(r,G,{vals:w,layer:$,transFn:T,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((Q=J.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=J.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(J.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=T[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=T[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":152,"../../lib":176,"../../lib/extend":171,"../../lib/setcursor":195,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../plots/cartesian/axis_defaults":222,"../../plots/cartesian/layout_attributes":234,"../../plots/cartesian/position_defaults":237,"../../plots/plots":254,"../../registry":262,"../color":50,"../colorscale/helpers":61,"../dragelement":69,"../drawing":72,"../titles":145,"./constants":52,d3:14,tinycolor2:33}],55:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":176}],56:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":51,"./defaults":53,"./draw":54,"./has_colorbar":55}],57:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":191,"../colorbar/attributes":51,"./scales.js":65}],58:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":176,"./helpers":61,"fast-isnumeric":16}],59:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],67:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":176}],68:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],69:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":176,"../../plots/cartesian/constants":226,"./align":66,"./cursor":67,"./unhover":70,"has-hover":18,"has-passive-events":19,"mouse-event-offset":22}],70:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":169,"../../lib/events":170,"../../lib/throttle":198,"../fx/constants":84}],71:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],72:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=k[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=v),P++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(I);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":86,"../../constants/alignment":152,"../../constants/interactions":155,"../../constants/xmlns_namespaces":157,"../../lib":176,"../../lib/svg_text_utils":197,"../../registry":262,"../../traces/scatter/make_bubble_size_func":380,"../../traces/scatter/subtypes":387,"../color":50,"../colorscale":62,"./symbol_defs":73,d3:14,"fast-isnumeric":16,tinycolor2:33}],73:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:14}],74:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],75:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":387,"../drawing":72,d3:14,"fast-isnumeric":16}],80:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":50,d3:14}],81:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":171,"../../plots/font_attributes":248,"./layout_attributes":91}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),I="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(I[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==X&&0===W.length){G.distance=X,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=X}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>p.spikeDistance)&&(J.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>p.spikeDistance)&&(J.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:ke,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],T=w.datum;T.offset=w.dp,T.del=w.del}}}(Le,ke?"xa":"ya",u),O(Le,ke));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:I})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],T=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,E=D.width,I=D.height,R=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(R){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-k)+",0L"+S+","+A+k+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+k+"H"+(S-2*k)+"Z")):l.attr("d","M0,0L"+k+","+A+k+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+k+"H-"+k+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=T._offset+T._length):(C="end",P=-1,D="-",m=T._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+k+","+k+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+k+"V-"+k+"Z");var E,I=x.height/2,R=z-x.top-I,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=$+ne>=I;return ne<=I&&($<=z?$=L._offset+2*M:ae&&($=I-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,R,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),T=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();T=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=D.width+k+M+T;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=T,e.offset=0,l)e.pos=F,S=N+H/2+j<=I,P=N-H/2-j>=0,"top"!==e.idealAlign&&S||!P?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,P=F-B/2-j>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),T&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(k+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-T,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*k+d)+","+(k+p)+"v"+(e.by/2-k)+"h"+o*e.bx+"v-"+e.by+"H"+(o*k+d)+"V"+(p-k)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=F,D=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),P=s.t+(1-B)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":I,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:R}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":176,"../../lib/events":170,"../../lib/override_cursor":187,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../registry":262,"../color":50,"../dragelement":69,"../drawing":72,"../legend/defaults":102,"../legend/draw":103,"./constants":84,"./helpers":86,d3:14,"fast-isnumeric":16,tinycolor2:33}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":176,"../color":50,"./helpers":86}],89:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":176,"../../plot_api/plot_template":210,"../../plots/layout_attributes":252,"../../registry":262,"./attributes":100,"./helpers":106}],103:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?T(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var E=z.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var P=0;if(s){var D=0,z=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,E+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,E),z+=r})),a._width=Math.max(P,z)+u,a._height=E+D+g}else{var I=r.size(),R=O+f+(I-1)*ha._maxWidth&&(P=Math.max(P,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,k=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-t._width),k=a.constrain(k,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,k),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,E,I,R=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-R-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,R,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),R,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(I,z,E),R,B))}));D.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(I,z,E),R,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":152,"../../lib":176,"../../lib/events":170,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../../registry":262,"../color":50,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:14}],104:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=f||m,k=p||v,M=w||!T?"M5,0":k?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":176,"../../registry":262,"../../traces/pie/helpers":355,"../../traces/pie/style_one":361,"../../traces/scatter/subtypes":387,"../color":50,"../colorscale/helpers":61,"../drawing":72,d3:14}],109:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=R[r+1];else if(e=n.pmax)t=R[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");Y(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?X:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),J(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;J(l)}};function Y(r){if(m(e))z=null;else if(R)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),I?N("yanchor",r.yanchor=U(T+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else if(R){if("resize-over-start-point"===z){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=I?d:U(d))}else if("resize-over-end-point"===z){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=I?h:U(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),Y=m("e"),X=b?k+a:k,W=G?M+a:M,J=Z?A+n:A,$=Y?L+n:L;I&&(b&&(X=k-a),G&&(W=M-a)),(!I&&W-X>10||I&&X-W>10)&&(N(S,r[S]=I?X:U(X)),N(C,r[C]=I?W:U(W))),$-J>10&&(N(O,r[O]=E?J:q(J)),N(P,r[P]=E?$:q($)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function J(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=Y}(e,E,s,t,r,z):!0===s.editable&&E.style("pointer-events",P||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),T=Math.abs(_-u),k="A"+w+","+T,M=b+w+","+_;return"M"+M+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(k=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(I),D&&(L?E.on(".opacity",null):(k=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":152,"../../constants/interactions":155,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../../registry":262,"../color":50,"../drawing":72,d3:14,"fast-isnumeric":16}],146:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":171,"../../plot_api/edit_types":203,"../../plot_api/plot_template":210,"../../plots/font_attributes":248,"../../plots/pad_attributes":253,"../color/attributes":49}],147:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":176,"../../plots/array_container_defaults":216,"./attributes":146,"./constants":147}],149:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>T,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,E=v;z+P>s&&(z=s-P);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:E,width:P,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=T-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+P+.5:f+.5,B=d-.5,H=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+R).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":176,"../color":50,"../drawing":72,d3:14}],152:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],153:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],154:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],155:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],156:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],157:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],158:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],161:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],162:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":183}],163:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(k,P.toMonthIndex(k,M,D),A)}else O=P.newDate(k,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(k),z.getUTCMonth()!==M||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,k=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":183}],175:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],176:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var T=e("./dom");function k(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":156,"./anchor_utils":161,"./angles":162,"./array":163,"./clean_number":164,"./clear_responsive":166,"./coerce":167,"./dates":168,"./dom":169,"./extend":171,"./filter_unique":172,"./filter_visible":173,"./geometry2d":174,"./identity":175,"./is_plain_object":177,"./keyed_container":178,"./localize":179,"./loggers":180,"./make_trace_groups":181,"./matrix":182,"./mod":183,"./nested_property":184,"./noop":185,"./notifier":186,"./push_unique":189,"./regex":191,"./relative_attr":192,"./relink_private":193,"./search":194,"./stats":196,"./throttle":198,"./to_log_range":199,d3:14,"fast-isnumeric":16}],177:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],178:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":208,"./notifier":186}],181:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:14}],182:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],184:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":156,"./matrix":182}],189:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":163,"fast-isnumeric":16}],197:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],199:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":16}],200:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],201:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],202:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===D)E=L;else{for(z=Math.max(C.length,z),E=[],x=0;x=D);x++)E.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),T.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[I];)I--;var R=z.parts[I],F=z.parts[I-1]+"."+R,H=z.parts.slice(0,I).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=z.get();if(void 0!==E){k[D]=E,L[D]="reverse"===R?E:N(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var J="height"===D?"width":"height";S(J,s[J])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))P(F),l(s,H+"._inputRange").set(null);else if(F.match(Y)){P(F),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&l(s,H+"._inputDomain").set(null);if("type"===R){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var ae=l(s,D).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[D]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,T.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":176,"../plots/attributes":217}],211:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(y(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,V,q,U,G,Z,Y=v._bgLayer.selectAll(".bg").data(M);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":176,"../plots/attributes":217,"../plots/plots":254,"./plot_config":208,"./plot_schema":209,"./plot_template":210}],213:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(k);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":176,"../plots/plots":254,"../snapshot/helpers":266,"../snapshot/svgtoimg":268,"../snapshot/tosvg":270,"../version":402,"./plot_api":207,"fast-isnumeric":16}],214:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(k);if(P&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,k[A].length):D);M++)L=P?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(T)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=k?[Math.max(0,C),Math.max(1,O)]:[C,O]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return T=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":156,"../../lib":176,"../../registry":262,"fast-isnumeric":16}],220:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,T=e("../../constants/alignment"),k=T.MID_SHIFT,M=T.CAP_SHIFT,A=T.LINE_SPACING,L=T.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Y(e.exponentformat)&&!X(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,R)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,R))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,R)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,R));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Y(p)&&X(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function Y(e){return"SI"===e||"B"===e}function X(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":Y(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}X&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||X&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*k},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||T)for(r=0;rz&&RP&&(P=R);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:P,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){ke="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(ke="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){ke="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":176,"fast-isnumeric":16}],238:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":152}],239:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,k=e("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,P=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)Y._fullLayout._deactivateShape(Y);else if(!H){var r=X.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,Y,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&Y.emit("plotly_selected",void 0);l.click(Y,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":50,"../../components/dragelement/helpers":68,"../../components/drawing":72,"../../components/fx":90,"../../components/fx/helpers":86,"../../components/shapes/draw_newshape/display_outlines":135,"../../components/shapes/draw_newshape/helpers":136,"../../components/shapes/draw_newshape/newshapes":137,"../../lib":176,"../../lib/clear_gl_canvases":165,"../../lib/polygon":188,"../../lib/throttle":198,"../../plot_api/subroutines":211,"../../registry":262,"./axis_ids":223,"./constants":226,"./handle_outline":230,"./helpers":231,polybooljs:24}],240:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(e){return Math.pow(10,e)}function k(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(k(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var E=function(t){return a(t)?D(t,e._m,e._b):p},I=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var R="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=R;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},I=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?T:c,e.l2p=E,e.p2l=I,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return T(I(e))}:I,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=I,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return T(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=T,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return T(I(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=I,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(I(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,k=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":72,"../../lib":176,"../../registry":262,"./axes":220,d3:14}],245:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),L(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,S=h[M].r.size;if(A>_){var C=(w*A+(S-d)*_)/(A-_),O=(S*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(k)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>T){var z=(k*P+(D-p)*T)/(P-T),E=(D*(1-T)+(k-p)*(1-P))/(P-T);z>=0&&E>=0&&p-(E+z)>0&&z+E>f+u&&(f=z,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(P(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(E)}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 I,R=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));I.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!k){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":152,"../../../lib":176,d3:14}],259:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":50,"../../../lib":176,"./micropolar":258,"./undo_manager":260,d3:14}],260:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":50,"../components/drawing":72,"../constants/xmlns_namespaces":157,"../lib":176,d3:14}],271:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(T=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var P=g[e.index],D=v.base?P.b+P.s:P.s;e[f+"0"]=e[f+"1"]=C.c2p(P[f],!0),e[f+"LabelVal"]=D;var z=m.extents[m.extents.round(P.p)];return e[u+"0"]=S.c2p(y?T(P):z[0],!0),e[u+"1"]=S.c2p(y?k(P):z[1],!0),e[u+"LabelVal"]=P.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(P)+function(e){return M(_(e),w(e))}(P))/2-b,e[u+"Spike"]=S.c2p(P.p,!0),o(P,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":50,"../../components/fx":90,"../../constants/numerical":156,"../../lib":176,"../../plots/cartesian/axes":220,"../../registry":262,"./helpers":278}],280:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":233,"../scatter/marker_colorbar":381,"./arrays_to_calcdata":271,"./attributes":272,"./calc":273,"./cross_trace_calc":275,"./defaults":276,"./event_data":277,"./hover":279,"./layout_attributes":281,"./layout_defaults":282,"./plot":283,"./select":284,"./style":286}],281:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],282:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,I),B=G(B,N,I),H=G(H,j,!I),j=G(j,H,!I)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&R){var Y=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,Y,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function P(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var D=n[0].trace,z="h"===D.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(D,a);var I="stack"===v.mode||"relative"===v.mode,R=n[a],F=!I||R._outmost;if(!E||"none"===w||(R.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],D),H=h.getInsideTextFont(D,a,N,B),j=h.getOutsideTextFont(D,a,N),V=r.datum();z?"log"===T.type&&V.s0<=0&&(l=T.range[0]=G*(W/Z):W>=Z*(X/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){Y=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=P(r,E,Y)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=D.textangle;"outside"===w?(te="both"===D.constraintext||"outside"===D.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,M=0,A=l?k(t,e):k(r,n);l?(b=t-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re})):(te="both"===D.constraintext||"inside"===D.constraintext,ee=C(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re,anchor:D.insidetextanchor}));ee.fontSize=Y.size,d(D.type,ee,O),R.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,D,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,D,t,v)},toMoveInsideBar:C}},{"../../components/color":50,"../../components/drawing":72,"../../components/fx/helpers":86,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../registry":262,"./attributes":272,"./constants":274,"./helpers":278,"./style":286,"./uniform_text":288,d3:14,"fast-isnumeric":16}],284:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":50,"../../components/drawing":72,"../../lib":176,"../../registry":262,"./attributes":272,"./helpers":278,"./uniform_text":288,d3:14}],287:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61}],288:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var U=S.pointpos,G=S.jitter,Z=S.marker.size/2,Y=0;U+G>=0&&((Y=V*(U+G))>A?(q=!0,H=Z,N=Y):Y>R&&(H=Z,N=A)),Y<=A&&(N=A);var X=0;U-G<=0&&((X=-V*(U-G))>L?(q=!0,j=Z,B=X):X>F&&(j=Z,B=L)),X<=L&&(B=L)}else N=A,B=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.pos,c=t.val,u=i.bPos,f=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var p=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(e){var t=s.c2l(e.pos+u,!0),a=s.l2p(t)+f,i=s.l2p(t-o)+f,p=s.l2p(t+l)+f,h=c.c2p(e.mean,!0),g=c.c2p(e.mean-e.sd,!0),v=c.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+h+","+i+"V"+p+("sd"===d?"m0,0L"+g+","+a+"L"+h+","+i+"L"+v+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+h+"H"+p+("sd"===d?"m0,0L"+a+","+g+"L"+i+","+h+"L"+a+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":72,"../../lib":176,d3:14}],294:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":50,"../../components/drawing":72,d3:14}],295:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../ohlc/attributes"),i=e("../box/attributes");function o(e){return{line:{color:n({},i.line.color,{dflt:e}),width:i.line.width,editType:"style"},fillcolor:i.fillcolor,editType:"style"}}t.exports={x:a.x,open:a.open,high:a.high,low:a.low,close:a.close,line:{width:n({},i.line.width,{}),editType:"style"},increasing:o(a.increasing.line.color.dflt),decreasing:o(a.decreasing.line.color.dflt),text:a.text,hovertext:a.hovertext,whiskerwidth:n({},i.whiskerwidth,{dflt:0}),hoverlabel:a.hoverlabel}},{"../../lib":176,"../box/attributes":289,"../ohlc/attributes":341}],296:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../ohlc/calc").calcCommon;function o(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,l=a.getFromId(e,t.xaxis),s=a.getFromId(e,t.yaxis),c=l.makeCalcdata(t,"x"),u=i(e,t,c,s,o);return u.length?(n.extendFlat(u[0].t,{num:r._numBoxes,dPos:n.distinctVals(c).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,u):[{t:{empty:!0}}]}},{"../../lib":176,"../../plots/cartesian/axes":220,"../ohlc/calc":342}],297:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("./attributes");function l(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function s(r,a){return n.coerce(e,t,o,r,a)}i(e,t,s,a)?(s("line.width"),l(e,t,s,"increasing"),l(e,t,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":50,"../../lib":176,"../ohlc/ohlc_defaults":346,"./attributes":295}],298:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":233,"../box/cross_trace_calc":290,"../box/layout_attributes":291,"../box/layout_defaults":292,"../box/plot":293,"../box/style":294,"../ohlc/hover":344,"../ohlc/select":348,"./attributes":295,"./calc":296,"./defaults":297}],299:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(c,f),[l]}}},{"../../components/color":50,"../../lib":176,"../bar/hover":279}],307:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"../bar/select":284,"./attributes":300,"./calc":301,"./cross_trace_calc":303,"./defaults":304,"./event_data":305,"./hover":306,"./layout_attributes":308,"./layout_defaults":309,"./plot":310,"./style":311}],308:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],309:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":50,"../../components/drawing":72,"../../constants/interactions":155,"../bar/style":286,"../bar/uniform_text":288,d3:14}],312:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":171,"../../plots/attributes":217,"../../plots/domain":247,"../../plots/template_attributes":261,"../pie/attributes":350}],313:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":254}],314:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":352}],315:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),f=c("values"),d=l(u,f),p=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,g=c("text"),v=c("texttemplate");if(v||(h=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),v||h&&"none"!==h){var m=c("textposition");o(e,t,s,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":176,"../../plots/domain":247,"../bar/defaults":276,"../pie/defaults":353,"./attributes":312}],316:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":361,"./attributes":312,"./base_plot":313,"./calc":314,"./defaults":315,"./layout_attributes":317,"./layout_defaults":318,"./plot":319,"./style":320}],317:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":357}],318:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":176,"./layout_attributes":317}],319:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../lib"),o=e("../../lib/svg_text_utils"),l=e("../bar/plot").toMoveInsideBar,s=e("../bar/uniform_text"),c=s.recordMinTextSize,u=s.clearMinTextSize,f=e("../pie/helpers"),d=e("../pie/plot"),p=d.attachFxHandlers,h=d.determineInsideTextFont,g=d.layoutAreas,v=d.prerenderTitles,m=d.positionTitleOutside,y=d.formatSliceLabel;function x(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;u("funnelarea",r),v(t,e),g(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var s=n.select(this),u=t[0],d=u.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var f,d,p=[];for(p.push(u()),f=e.length-1;f>-1;f--)if(!(d=e[f]).hidden){var h=d.v/s;c+=h,p.push(u())}var g=1/0,v=-1/0;for(f=0;f-1;f--)if(!(d=e[f]).hidden){var M=p[k+=1][0],A=p[k][1];d.TL=[-M,A],d.TR=[M,A],d.BL=w,d.BR=T,d.pxmid=(L=d.TR,S=d.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=d.TL,T=d.TR}var L,S}(t),s.each((function(){var s=n.select(this).selectAll("g.slice").data(t);s.enter().append("g").classed("slice",!0),s.exit().remove(),s.each((function(s,g){if(s.hidden)n.select(this).selectAll("path,g").remove();else{s.pointNumber=s.i,s.curveNumber=d.index;var v=u.cx,m=u.cy,b=n.select(this),_=b.selectAll("path.surface").data([s]);_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),b.call(p,e,t);var w="M"+(v+s.TR[0])+","+(m+s.TR[1])+x(s.TR,s.BR)+x(s.BR,s.BL)+x(s.BL,s.TL)+"Z";_.attr("d",w),y(e,s,u);var T=f.castOption(d.textposition,s.pts),k=b.selectAll("g.slicetext").data(s.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var u=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=i.ensureUniformFontSize(e,h(d,s,r.font));u.text(s.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,f).call(o.convertToTspans,e);var p,y,x,b=a.bBox(u.node()),_=Math.min(s.BL[1],s.BR[1])+m,w=Math.max(s.TL[1],s.TR[1])+m;y=Math.max(s.TL[0],s.BL[0])+v,x=Math.min(s.TR[0],s.BR[0])+v,(p=l(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,c(d.type,p,r),t[g].transform=p,u.attr("transform",i.getTextTransform(p))}))}}));var g=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),l=d.title.text;d._meta&&(l=i.templateString(l,d._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,d.title.font).call(o.convertToTspans,e);var s=m(u,r._size);t.attr("transform","translate("+s.x+","+s.y+")"+(s.scale<1?"scale("+s.scale+")":"")+"translate("+s.tx+","+s.ty+")")}))}))}))}},{"../../components/drawing":72,"../../lib":176,"../../lib/svg_text_utils":197,"../bar/plot":283,"../bar/uniform_text":288,"../pie/helpers":355,"../pie/plot":359,d3:14}],320:[function(e,t,r){"use strict";var n=e("d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":288,"../pie/style_one":361,d3:14}],321:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("./bin_attributes"),o=e("./constants"),l=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":171,"../../plots/template_attributes":261,"../bar/attributes":272,"./bin_attributes":323,"./constants":327}],322:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&mo){var y=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(N)&&(H=o.tickIncrement(H,b.size,!0,p)),E.start=r.l2r(H),F||a.nestedProperty(t,m+".start").set(E.start)}var j=b.end,V=r.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(j)){var U=q?V:a.aggNums(Math.max,null,h);E.end=r.l2r(U),q||a.nestedProperty(t,m+".start").set(E.end)}var G="autobin"+l;return!1===t._input[G]&&(t._input[m]=a.extendFlat({},t[m]||{}),delete t._input[G],delete t[G]),[E,h]}t.exports={calc:function(e,t){var r,i,p,h,g=[],v=[],m=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),y="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[y],b=t[y+"calendar"],_=t.cumulative,w=d(e,t,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],P=0,D=t.histnorm,z=t.histfunc,E=-1!==D.indexOf("density");_.enabled&&E&&(D=D.replace(/ ?density$/,""),E=!1);var I,R="max"===z||"min"===z?null:0,F=s.count,N=c[D],B=!1,H=function(e){return m.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==z&&(I=t[x],B="avg"===z,F=s[z]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),J=[],$=0,K=Q-1;for(r=0;r=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var ee={p:g[r],s:v[r],b:0};_.enabled||(ee.pts=O[r],G?ee.ph0=ee.ph1=O[r].length?k[O[r][0]]:g[r]:(t._computePh=!0,ee.ph0=q(A[r]),ee.ph1=q(A[r+1],!0))),J.push(ee)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),l(J,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(J,t,X),J},calcAllAutoBins:d}},{"../../lib":176,"../../plots/cartesian/axes":220,"../../registry":262,"../bar/arrays_to_calcdata":271,"./average":322,"./bin_functions":324,"./bin_label_vals":325,"./norm_functions":333,"fast-isnumeric":16}],327:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],328:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,g,v,m=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function x(e){e.each((function(e){h.stroke(n.select(this),e.line.color)})).each((function(e){h.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function b(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return a.coerce(i,o,p,e,t)}return f(i,o,s,l,n),d(i,o,s,l),o}function _(e,t){return"translate("+e+","+t+")"}function w(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function T(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(c.convertToTspans,a).call(l.font,t),l.bBox(o.node())}function k(e,t,r,n,i,o){var l="_cache"+t;e[l]&&e[l].key===i||(e[l]={key:i,value:r});var s=a.aggNums(o,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,f){var d,p=e._fullLayout;y(r)&&f&&(d=f()),a.makeTraceGroups(p._indicatorlayer,t,"trace").each((function(t){var f,M,A,L,S,C=t[0].trace,O=n.select(this),P=C._hasGauge,D=C._isAngular,z=C._isBullet,E=C.domain,I={w:p._size.w*(E.x[1]-E.x[0]),h:p._size.h*(E.y[1]-E.y[0]),l:p._size.l+p._size.w*E.x[0],r:p._size.r+p._size.w*(1-E.x[1]),t:p._size.t+p._size.h*(1-E.y[1]),b:p._size.b+p._size.h*E.y[0]},R=I.l+I.w/2,F=I.t+I.h/2,N=Math.min(I.w/2,I.h),B=s.innerRadius*N,H=C.align||"center";if(M=F,P){if(D&&(f=R,M=F+N/2,A=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*B)}),z){var j=s.bulletPadding,V=1-s.bulletNumberDomainSize+j;f=I.l+(V+(1-V)*v[H])*I.w,A=function(e){return w(e,(s.bulletNumberDomainSize-j)*I.w,I.h)}}}else f=I.l+v[H]*I.w,A=function(e){return w(e,I.w,I.h)};!function(e,t,r,i){var o,s,f,d=r[0].trace,p=i.numbersX,x=i.numbersY,w=d.align||"center",M=g[w],A=i.transitionOpts,L=i.onComplete,S=a.ensureSingle(t,"g","numbers"),C=[];d._hasNumber&&C.push("number");d._hasDelta&&(C.push("delta"),"left"===d.delta.position&&C.reverse());var O=S.selectAll("text").data(C);function P(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(m)||r(a).slice(-1).match(m))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=b(e,{tickformat:i});return function(e){return Math.abs(e)<1?u.tickText(o,e).text:r(e)}}O.enter().append("text"),O.attr("text-anchor",(function(){return M})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),O.exit().remove();var D,z=d.mode+d.align;d._hasDelta&&(D=function(){var t=b(e,{tickformat:d.delta.valueformat},d._range);t.setScale(),u.prepTicks(t);var a=function(e){return u.tickText(t,e).text},i=function(e){return d.delta.relative?e.relativeDelta:e.delta},o=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?d.delta.increasing.symbol:d.delta.decreasing.symbol)+t(e)},f=function(e){return e.delta>=0?d.delta.increasing.color:d.delta.decreasing.color};void 0===d._deltaLastValue&&(d._deltaLastValue=i(r[0]));var p=S.select("text.delta");function g(){p.text(o(i(r[0]),a)).call(h.fill,f(r[0])).call(c.convertToTspans,e)}return p.call(l.font,d.delta.font).call(h.fill,f({delta:d._deltaLastValue})),y(A)?p.transition().duration(A.duration).ease(A.easing).tween("text",(function(){var e=n.select(this),t=i(r[0]),l=d._deltaLastValue,s=P(d.delta.valueformat,a,l,t),c=n.interpolateNumber(l,t);return d._deltaLastValue=t,function(t){e.text(o(c(t),s)),e.call(h.fill,f({delta:c(t)}))}})).each("end",(function(){g(),L&&L()})).each("interrupt",(function(){g(),L&&L()})):g(),s=T(o(i(r[0]),a),d.delta.font,M,e),p}(),z+=d.delta.position+d.delta.font.size+d.delta.font.family+d.delta.valueformat,z+=d.delta.increasing.symbol+d.delta.decreasing.symbol,f=s);d._hasNumber&&(!function(){var t=b(e,{tickformat:d.number.valueformat},d._range);t.setScale(),u.prepTicks(t);var a=function(e){return u.tickText(t,e).text},i=d.number.suffix,s=d.number.prefix,f=S.select("text.number");function p(){var t="number"==typeof r[0].y?s+a(r[0].y)+i:"-";f.text(t).call(l.font,d.number.font).call(c.convertToTspans,e)}y(A)?f.transition().duration(A.duration).ease(A.easing).each("end",(function(){p(),L&&L()})).each("interrupt",(function(){p(),L&&L()})).attrTween("text",(function(){var e=n.select(this),t=n.interpolateNumber(r[0].lastY,r[0].y);d._lastValue=r[0].y;var o=P(d.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(s+o(t(r))+i)}})):p(),o=T(s+a(r[0].y)+i,d.number.font,M,e)}(),z+=d.number.font.size+d.number.font.family+d.number.valueformat+d.number.suffix+d.number.prefix,f=o);if(d._hasDelta&&d._hasNumber){var E,I,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(s.left+s.right)/2,(s.top+s.bottom)/2],N=.75*d.delta.font.size;"left"===d.delta.position&&(E=k(d,"deltaPos",0,-1*(o.width*v[d.align]+s.width*(1-v[d.align])+N),z,Math.min),I=R[1]-F[1],f={width:o.width+s.width+N,height:Math.max(o.height,s.height),left:s.left+E,right:o.right,top:Math.min(o.top,s.top+I),bottom:Math.max(o.bottom,s.bottom+I)}),"right"===d.delta.position&&(E=k(d,"deltaPos",0,o.width*(1-v[d.align])+s.width*v[d.align]+N,z,Math.max),I=R[1]-F[1],f={width:o.width+s.width+N,height:Math.max(o.height,s.height),left:o.left,right:s.right+E,top:Math.min(o.top,s.top+I),bottom:Math.max(o.bottom,s.bottom+I)}),"bottom"===d.delta.position&&(E=null,I=s.height,f={width:Math.max(o.width,s.width),height:o.height+s.height,left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),top:o.bottom-o.height,bottom:o.bottom+s.height}),"top"===d.delta.position&&(E=null,I=o.top,f={width:Math.max(o.width,s.width),height:o.height+s.height,left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),top:o.bottom-o.height-s.height,bottom:o.bottom}),D.attr({dx:E,dy:I})}(d._hasNumber||d._hasDelta)&&S.attr("transform",(function(){var e=i.numbersScaler(f);z+=e[2];var t,r=k(d,"numbersScale",1,e[0],z,Math.min);d._scaleNumbers||(r=1),t=d._isAngular?x-r*f.bottom:x-r*(f.top+f.bottom)/2,d._numbersTop=r*f.top+t;var n=f[w];"center"===w&&(n=(f.left+f.right)/2);var a=p-r*n;return _(a=k(d,"numbersTranslate",0,a,z,Math.max),t)+" scale("+r+")"}))}(e,O,t,{numbersX:f,numbersY:M,numbersScaler:A,transitionOpts:r,onComplete:d}),P&&(L={range:C.gauge.axis.range,color:C.gauge.bgcolor,line:{color:C.gauge.bordercolor,width:0},thickness:1},S={range:C.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:C.gauge.bordercolor,width:C.gauge.borderwidth},thickness:1});var q=O.selectAll("g.angular").data(D?t:[]);q.exit().remove();var U=O.selectAll("g.angularaxis").data(D?t:[]);U.exit().remove(),D&&function(e,t,r,a){var l,s,c,f,d=r[0].trace,p=a.size,h=a.radius,g=a.innerRadius,v=a.gaugeBg,m=a.gaugeOutline,w=[p.l+p.w/2,p.t+p.h/2+h/2],T=a.gauge,k=a.layer,M=a.transitionOpts,A=a.onComplete,L=Math.PI/2;function S(e){var t=d.gauge.axis.range[0],r=(e-t)/(d.gauge.axis.range[1]-t)*Math.PI-L;return r<-L?-L:r>L?L:r}function C(e){return n.svg.arc().innerRadius((g+h)/2-e/2*(h-g)).outerRadius((g+h)/2+e/2*(h-g)).startAngle(-L)}function O(e){e.attr("d",(function(e){return C(e.thickness).startAngle(S(e.range[0])).endAngle(S(e.range[1]))()}))}T.enter().append("g").classed("angular",!0),T.attr("transform",_(w[0],w[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(l=b(e,d.gauge.axis)).type="linear",l.range=d.gauge.axis.range,l._id="xangularaxis",l.setScale();var P=function(e){return(l.range[0]-e.x)/(l.range[1]-l.range[0])*Math.PI+Math.PI},D={},z=u.makeLabelFns(l,0).labelStandoff;D.xFn=function(e){var t=P(e);return Math.cos(t)*z},D.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(z+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*o)},D.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},D.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var E=function(e){return _(w[0]+h*Math.cos(e),w[1]-h*Math.sin(e))};c=function(e){return E(P(e))};if(s=u.calcTicks(l),f=u.getTickSigns(l)[2],l.visible){f="inside"===l.ticks?-1:1;var I=(l.linewidth||1)/2;u.drawTicks(e,l,{vals:s,layer:k,path:"M"+f*I+",0h"+f*l.ticklen,transFn:function(e){var t=P(e);return E(t)+"rotate("+-i(t)+")"}}),u.drawLabels(e,l,{vals:s,layer:k,transFn:c,labelFns:D})}var R=[v].concat(d.gauge.steps),F=T.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(O).call(x),F.exit().remove();var N=C(d.gauge.bar.thickness),B=T.selectAll("g.value-arc").data([d.gauge.bar]);B.enter().append("g").classed("value-arc",!0).append("path");var H=B.select("path");y(M)?(H.transition().duration(M.duration).ease(M.easing).each("end",(function(){A&&A()})).each("interrupt",(function(){A&&A()})).attrTween("d",(j=N,V=S(r[0].lastY),q=S(r[0].y),function(){var e=n.interpolate(V,q);return function(t){return j.endAngle(e(t))()}})),d._lastValue=r[0].y):H.attr("d","number"==typeof r[0].y?N.endAngle(S(r[0].y)):"M0,0Z");var j,V,q;H.call(x),B.exit().remove(),R=[];var U=d.gauge.threshold.value;U&&R.push({range:[U,U],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var G=T.selectAll("g.threshold-arc").data(R);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(O).call(x),G.exit().remove();var Z=T.selectAll("g.gauge-outline").data([m]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(O).call(x),Z.exit().remove()}(e,0,t,{radius:N,innerRadius:B,gauge:q,layer:U,size:I,gaugeBg:L,gaugeOutline:S,transitionOpts:r,onComplete:d});var G=O.selectAll("g.bullet").data(z?t:[]);G.exit().remove();var Z=O.selectAll("g.bulletaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,n){var a,i,o,l,c,f=r[0].trace,d=n.gauge,p=n.layer,g=n.gaugeBg,v=n.gaugeOutline,m=n.size,_=f.domain,w=n.transitionOpts,T=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform","translate("+m.l+", "+m.t+")"),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=m.h,M=f.gauge.bar.thickness*k,A=_.x[0],L=_.x[0]+(_.x[1]-_.x[0])*(f._hasNumber||f._hasDelta?1-s.bulletNumberDomainSize:1);(a=b(e,f.gauge.axis))._id="xbulletaxis",a.domain=[A,L],a.setScale(),i=u.calcTicks(a),o=u.makeTransFn(a),l=u.getTickSigns(a)[2],c=m.t+m.h,a.visible&&(u.drawTicks(e,a,{vals:"inside"===a.ticks?u.clipEnds(a,i):i,layer:p,path:u.makeTickPath(a,c,l),transFn:o}),u.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:u.makeLabelFns(a,c)}));function S(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var C=[g].concat(f.gauge.steps),O=d.selectAll("g.bg-bullet").data(C);O.enter().append("g").classed("bg-bullet",!0).append("rect"),O.select("rect").call(S).call(x),O.exit().remove();var P=d.selectAll("g.value-bullet").data([f.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(k-M)/2).call(x),y(w)?P.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){T&&T()})).each("interrupt",(function(){T&&T()})).attr("width",Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var D=r.filter((function(){return f.gauge.threshold.value})),z=d.selectAll("g.threshold-bullet").data(D);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",a.c2p(f.gauge.threshold.value)).attr("x2",a.c2p(f.gauge.threshold.value)).attr("y1",(1-f.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-f.gauge.threshold.thickness)/2)*k).call(h.stroke,f.gauge.threshold.line.color).style("stroke-width",f.gauge.threshold.line.width),z.exit().remove();var E=d.selectAll("g.gauge-outline").data([v]);E.enter().append("g").classed("gauge-outline",!0).append("rect"),E.select("rect").call(S).call(x),E.exit().remove()}(e,0,t,{gauge:G,layer:Z,size:I,gaugeBg:L,gaugeOutline:S,transitionOpts:r,onComplete:d});var Y=O.selectAll("text.title").data(t);Y.exit().remove(),Y.enter().append("text").classed("title",!0),Y.attr("text-anchor",(function(){return z?g.right:g[C.title.align]})).text(C.title.text).call(l.font,C.title.font).call(c.convertToTspans,e),Y.attr("transform",(function(){var e,t=I.l+I.w*v[C.title.align],r=s.titlePadding,n=l.bBox(Y.node());if(P){if(D)if(C.gauge.axis.visible)e=l.bBox(U.node()).top-r-n.bottom;else e=I.t+I.h/2-N/2-n.bottom-r;z&&(e=M-(n.top+n.bottom)/2,t=I.l-s.bulletPadding*I.w)}else e=C._numbersTop-r-n.bottom;return _(t,e)}))}))}},{"../../components/color":50,"../../components/drawing":72,"../../constants/alignment":152,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../plots/cartesian/axis_defaults":222,"../../plots/cartesian/layout_attributes":234,"../../plots/cartesian/position_defaults":237,"./constants":337,d3:14}],341:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../components/fx/attributes"),l=e("../../constants/delta.js"),s=l.INCREASING.COLOR,c=l.DECREASING.COLOR,u=a.line;function f(e){return{line:{color:n({},u.color,{dflt:e}),width:u.width,dash:i,editType:"style"},editType:"style"}}t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},u.width,{}),dash:n({},i,{}),editType:"style"},increasing:f(s),decreasing:f(c),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":71,"../../components/fx/attributes":81,"../../constants/delta.js":153,"../../lib":176,"../scatter/attributes":363}],342:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../constants/numerical").BADNUM;function l(e,t,r,n){return{o:e,h:t,l:r,c:n}}function s(e,t,r,l,s){for(var c=l.makeCalcdata(t,"open"),u=l.makeCalcdata(t,"high"),f=l.makeCalcdata(t,"low"),d=l.makeCalcdata(t,"close"),p=Array.isArray(t.text),h=Array.isArray(t.hovertext),g=!0,v=null,m=[],y=0;yv):g=T>b,v=T;var k=s(b,_,w,T);k.pos=x,k.yc=(b+T)/2,k.i=y,k.dir=g?"increasing":"decreasing",k.x=k.pos,k.y=[w,_],p&&(k.tx=t.text[y]),h&&(k.htx=t.hovertext[y]),m.push(k)}else m.push({pos:x,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,n.concat(f,u),{padded:!0}),m.length&&(m[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),m}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),o=function(e,t,r){var a=r._minDiff;if(!a){var i,o=e._fullData,l=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b):((y=a.extendFlat({},d)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(l,b),y.name="",f.push(y),v[b]=y)}return f}function d(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,f=i[0].t,d=u(e,t,r,a);if(!d)return[];var p=i[d.index],h=d.index=p.i,g=p.dir;function v(e){return f.labels[e]+n.hoverLabelText(o,s[e][h])}var m=p.hi||s.hoverinfo,y=m.split("+"),x="all"===m,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[v("open"),v("high"),v("low"),v("close")+" "+c[g]]:[];return _&&l(p,s,w),d.extraText=w.join("
"),d.y0=d.y1=o.c2p(p.yc,!0),[d]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):d(e,t,r,n)},hoverSplit:f,hoverOnPoints:d}},{"../../components/color":50,"../../components/fx":90,"../../constants/delta.js":153,"../../lib":176,"../../plots/cartesian/axes":220}],345:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":233,"./attributes":341,"./calc":342,"./defaults":343,"./hover":344,"./plot":347,"./select":348,"./style":349}],346:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var f=Math.min(l.length,s.length,c.length,u.length);return o&&(f=Math.min(f,a.minRowLength(o))),t._length=f,f}}},{"../../lib":176,"../../registry":262}],347:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.xaxis,l=t.yaxis;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var s=i.tickLen,c=t.selectAll("path").data(a.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=o.c2p(e.pos,!0),r=o.c2p(e.pos-s,!0),n=o.c2p(e.pos+s,!0);return"M"+r+","+l.c2p(e.o,!0)+"H"+t+"M"+t+","+l.c2p(e.h,!0)+"V"+l.c2p(e.l,!0)+"M"+n+","+l.c2p(e.c,!0)+"H"+t}))}}))}},{"../../lib":176,d3:14}],348:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":176,"../../plots/domain":247,"../bar/defaults":276,"./attributes":350,"fast-isnumeric":16}],354:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":86}],355:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:T(i,o/t),rotate:k(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:T(i,o/t),rotate:k(a+Math.PI/2)}}function T(e,t){return Math.cos(t)-e*t}function k(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),P(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===d.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}z(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:D(d.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=u+k[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),M=i.h*(T.y[1]-T.y[0]),A=(.5*k-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:T.x[0]-A,xr:T.x[1]+A,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:P,attachFxHandlers:m,computeTransform:E}},{"../../components/color":50,"../../components/drawing":72,"../../components/fx":90,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../bar/constants":274,"../bar/uniform_text":288,"./event_data":354,"./helpers":355,d3:14}],360:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":288,"./style_one":361,d3:14}],361:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":50,"./helpers":355}],362:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],370:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=D[O][1])>=G&&(E=D[O-1][0],I=D[O][0],F-R&&(z=E+(I-E)*(G-R)/(F-R),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":50,"../../components/fx":90,"../../lib":176,"../../registry":262,"./get_trace_color":373}],375:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"./arrays_to_calcdata":362,"./attributes":363,"./calc":364,"./cross_trace_calc":368,"./cross_trace_defaults":369,"./defaults":370,"./format_labels":372,"./hover":374,"./marker_colorbar":381,"./plot":383,"./select":384,"./style":386,"./subtypes":387}],376:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"../../lib":176}],377:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,E=t.baseTolerance,I=t.shape,R="linear"===I,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),J=null,W=Q=0}function fe(e){if(M=e[0]/P,A=e[1]/D,Y=e[0]re?re:0,X=e[1]ae?ae:0,Y||X){if(V)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else $=K(j[V-1],e)[0],j[V++]=$;else j[V++]=[Y||e[0],X||e[1]];var r=j[V-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Q!==X?ce(W&&Q?(n=J,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,Q||X]):W&&Q&&ce([W,Q])),ce([Y,X])):W-Y&&Q-X&&ce([Y||W,X||Q]),J=e,W=Y,Q=X}else J&&ue(K(J,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===I||"spline"===I?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}J&&ce([W||J[0],Q||J[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":156,"../../lib":176,"./constants":367}],378:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],379:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":16}],381:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],382:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"./subtypes":387}],383:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,D,z="",E=[],I=_._prevtrace;I&&(z=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var Y=M.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var T,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function J(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":72,"../../lib":176,"../../lib/polygon":188,"../../registry":262,"./line_points":377,"./link_traces":379,"./subtypes":387,d3:14}],384:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,h),[c]}function w(e){return n(p,e)}}},{"../../components/color":50,"../../constants/delta.js":153,"../../plots/cartesian/axes":220,"../bar/hover":279}],397:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"../bar/select":284,"./attributes":390,"./calc":391,"./cross_trace_calc":393,"./defaults":394,"./event_data":395,"./hover":396,"./layout_attributes":398,"./layout_defaults":399,"./plot":400,"./style":401}],398:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],399:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(v+=d?"M"+f[0]+","+h[1]+"V"+h[0]:"M"+f[1]+","+h[0]+"H"+f[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":50,"../../components/drawing":72,"../../constants/interactions":155,"../bar/style":286,"../bar/uniform_text":288,d3:14}],402:[function(e,t,r){"use strict";r.version="1.54.2"},{}]},{},[8])(8)})); \ No newline at end of file +var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":25,"./lib/epsilon":26,"./lib/geojson":27,"./lib/intersecter":28,"./lib/segment-chainer":30,"./lib/segment-selector":31}],25:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],26:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],27:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return D(e)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(e){return!!H.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],34:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],35:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":210,"../../plots/cartesian/constants":226,"../../plots/font_attributes":248,"./arrow_paths":34}],36:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":176,"../../plots/cartesian/axes":220,"./draw":41}],37:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(U=!0):U=!0),Y=te._offset+te.r2p(t[$]),Q=.5}else"x"===$?(W=t[$],Y=b.l+b.w*W):(W=1-t[$],Y=b.t+b.h*W),Q=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+$];J=ne*j(.5,t.xanchor)-ae*j(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=J):(se.tail=Y+ue,X=J+ue),se.text=se.tail+J;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=J=ie*j(Q,oe),se.text=Y+J;se.text+=le,J+=le,X+=le,t["_"+$+"padplus"]=ie/2+X,t["_"+$+"padminus"]=ie/2-X,t["_"+$+"size"]=ie,t["_"+$+"shift"]=J}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:R+he-1,y:R+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=R+ge-h.top,me=R+he-h.left;V.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}B.select("rect").call(c.setRect,R,R,w,D),F.call(c.setRect,E/2,E/2,I-E,H-E),z.call(c.setTranslate,Math.round(L.x.text-I/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),E=m-.5*P,I=E+P,R=y-.5*D,N=R+D,B=[[E,R,E,N],[E,N,I,N],[I,N,I,R],[I,R,E,R]].map(A);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var H=t.arrowwidth,j=t.arrowcolor,V=t.arrowside,q=C.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),U=q.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",H+"px").call(s.stroke,s.rgb(j));if(g(U,V,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",H+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&T(l._name+".autorange",!0),v&&v.autorange&&T(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),k("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),k("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&k("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&k("ay",v.p2r(v.r2p(t.ay)+r)),q.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),P)p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?k("ax",l.p2r(l.r2p(t.ax)+e)):k("ax",t.ax+e),t.ayref===t.yref?k("ay",v.p2r(v.r2p(t.ay)+r)):k("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}k("x",a),k("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var T=y*Math.cos(s),k=y*Math.sin(s);o.x-=T,o.y-=k,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":251,"../annotations/draw":41}],48:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+B,V+R-B],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var Q,J=e.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+k.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(V+R-B))*s.h+s.t+3+.75*n:(1-(V+B))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+k.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(P);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:H,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=H+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),T=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:$,path:l.makeTickPath(G,b,C),transFn:T}),l.drawLabels(r,G,{vals:w,layer:$,transFn:T,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((Q=J.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=J.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(J.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-U;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=T[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=T[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":152,"../../lib":176,"../../lib/extend":171,"../../lib/setcursor":195,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../plots/cartesian/axis_defaults":222,"../../plots/cartesian/layout_attributes":234,"../../plots/cartesian/position_defaults":237,"../../plots/plots":254,"../../registry":262,"../color":50,"../colorscale/helpers":61,"../dragelement":69,"../drawing":72,"../titles":145,"./constants":52,d3:14,tinycolor2:33}],55:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":176}],56:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":51,"./defaults":53,"./draw":54,"./has_colorbar":55}],57:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":191,"../colorbar/attributes":51,"./scales.js":65}],58:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":176,"./helpers":61,"fast-isnumeric":16}],59:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],67:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":176}],68:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],69:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":176,"../../plots/cartesian/constants":226,"./align":66,"./cursor":67,"./unhover":70,"has-hover":18,"has-passive-events":19,"mouse-event-offset":22}],70:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":169,"../../lib/events":170,"../../lib/throttle":198,"../fx/constants":84}],71:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],72:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=k[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=v),P++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var E=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(I);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":86,"../../constants/alignment":152,"../../constants/interactions":155,"../../constants/xmlns_namespaces":157,"../../lib":176,"../../lib/svg_text_utils":197,"../../registry":262,"../../traces/scatter/make_bubble_size_func":380,"../../traces/scatter/subtypes":387,"../color":50,"../colorscale":62,"./symbol_defs":73,d3:14,"fast-isnumeric":16,tinycolor2:33}],73:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:14}],74:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],75:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":387,"../drawing":72,d3:14,"fast-isnumeric":16}],80:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":50,d3:14}],81:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":171,"../../plots/font_attributes":248,"./layout_attributes":91}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,E="xval"in t?g.flat(s,t.xval):g.p2c(b,K),I="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(E[0])||!a(I[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(F=0;FZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==X&&0===W.length){G.distance=X,G.index=!1;var d=B._module.hoverPoints(G,q,U,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=X}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>p.spikeDistance)&&(J.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>p.spikeDistance)&&(J.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Me=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:ke,bgColor:Me,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],T=w.datum;T.offset=w.dp,T.del=w.del}}}(Le,ke?"xa":"ya",u),O(Le,ke));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:E,yvals:I})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],T=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,E=D.width,I=D.height,R=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(R){var F,N,B=!0;for(F=0;Fa.width-S?(m=a.width-S,l.attr("d","M"+(S-k)+",0L"+S+","+A+k+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+k+"H"+(S-2*k)+"Z")):l.attr("d","M0,0L"+k+","+A+k+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+k+"H-"+k+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=T._offset+T._length):(C="end",P=-1,D="-",m=T._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+k+","+k+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+k+"V-"+k+"Z");var E,I=x.height/2,R=z-x.top-I,F="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=$+ne>=I;return ne<=I&&($<=z?$=L._offset+2*M:ae&&($=I-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,R,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),T=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();T=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,B=Math.abs(e.x1-e.x0),H=Math.abs(e.y1-e.y0),j=D.width+k+M+T;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=T,e.offset=0,l)e.pos=F,S=N+H/2+j<=I,P=N-H/2-j>=0,"top"!==e.idealAlign&&S||!P?S?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,S=F+B/2+j<=E,P=F-B/2-j>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=B/2,e.anchor="start";else{e.anchor="middle";var V=j/2,q=F+V-E,U=F-V;q>0&&(F-=q),U<0&&(F+=-U)}else F-=B/2,e.anchor="end";y.attr("text-anchor",e.anchor),T&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=E(r,e.nameLength),""}))),[s,l]}function O(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(k+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-T,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*k+d)+","+(k+p)+"v"+(e.by/2-k)+"h"+o*e.bx+"v-"+e.by+"H"+(o*k+d)+"V"+(p-k)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=F,D=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),P=s.t+(1-B)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":I,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:R}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":176,"../../lib/events":170,"../../lib/override_cursor":187,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../registry":262,"../color":50,"../dragelement":69,"../drawing":72,"../legend/defaults":102,"../legend/draw":103,"./constants":84,"./helpers":86,d3:14,"fast-isnumeric":16,tinycolor2:33}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":176,"../color":50,"./helpers":86}],89:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":176,"../../plot_api/plot_template":210,"../../plots/layout_attributes":252,"../../registry":262,"./attributes":100,"./helpers":106}],103:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?T(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):M(g,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var E=z.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t})),x=null;var P=0;if(s){var D=0,z=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,E+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,E),z+=r})),a._width=Math.max(P,z)+u,a._height=E+D+g}else{var I=r.size(),R=O+f+(I-1)*ha._maxWidth&&(P=Math.max(P,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+t/2+h),H=N+r+h,N+=n,F=Math.max(F,t)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,E,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,k=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-t._width),k=a.constrain(k,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,k),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,E,I,R=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-R-2*p.scrollBarMargin,N=t._height-t._effHeight,B=F/N,H=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,e),q(H,R,B),g.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),R,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(E="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,N)}(I,z,E),R,B))}));D.call(j);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(E=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,N)}(I,z,E),R,B))}));C.call(V)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":152,"../../lib":176,"../../lib/events":170,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../../registry":262,"../color":50,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:14}],104:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=f||m,k=p||v,M=w||!T?"M5,0":k?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",M+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":176,"../../registry":262,"../../traces/pie/helpers":355,"../../traces/pie/style_one":361,"../../traces/scatter/subtypes":387,"../color":50,"../colorscale/helpers":61,"../drawing":72,d3:14}],109:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=R[r+1];else if(e=n.pmax)t=R[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");Y(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?X:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),J(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;J(l)}};function Y(r){if(m(e))z=null;else if(R)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else E?N("xanchor",r.xanchor=q(x+n)):(N("x0",r.x0=q(c+n)),N("x1",r.x1=q(v+n))),I?N("yanchor",r.yanchor=U(T+a)):(N("y0",r.y0=U(f+a)),N("y1",r.y1=U(y+a)));t.attr("d",_(e,r)),Q(l,r)}function W(n,a){if(F){var i=function(e){return e},o=i,s=i;E?N("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(j(e)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=U(T+a)):(s=function(e){return U(V(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),N("path",r.path=w(D,o,s))}else if(R){if("resize-over-start-point"===z){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:q(u)),N("y0",r.y0=I?d:U(d))}else if("resize-over-end-point"===z){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:q(p)),N("y1",r.y1=I?h:U(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),G=m("s"),Z=m("w"),Y=m("e"),X=b?k+a:k,W=G?M+a:M,J=Z?A+n:A,$=Y?L+n:L;I&&(b&&(X=k-a),G&&(W=M-a)),(!I&&W-X>10||I&&X-W>10)&&(N(S,r[S]=I?X:U(X)),N(C,r[C]=I?W:U(W))),$-J>10&&(N(O,r[O]=E?J:q(J)),N(P,r[P]=E?$:q($)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=j(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=V(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function J(e){e.selectAll(".visual-cue").remove()}d.init(Z),G.node().onmousemove=Y}(e,E,s,t,r,z):!0===s.editable&&E.style("pointer-events",P||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,E)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),T=Math.abs(_-u),k="A"+w+","+T,M=b+w+","+_;return"M"+M+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+M+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),M&&!d)&&(k=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return E.call(I),D&&(L?E.on(".opacity",null):(k=0,M=!0,E.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),E.classed("js-placeholder",M),w}}},{"../../constants/alignment":152,"../../constants/interactions":155,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../../registry":262,"../color":50,"../drawing":72,d3:14,"fast-isnumeric":16}],146:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":171,"../../plot_api/edit_types":203,"../../plot_api/plot_template":210,"../../plots/font_attributes":248,"../../plots/pad_attributes":253,"../color/attributes":49}],147:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":176,"../../plots/array_container_defaults":216,"./attributes":146,"./constants":147}],149:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>T,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,E=v;z+P>s&&(z=s-P);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:E,width:P,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=T-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+P+.5:f+.5,B=d-.5,H=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+R).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),O&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":176,"../color":50,"../drawing":72,d3:14}],152:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],153:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],154:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],155:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],156:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],157:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],158:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],161:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],162:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":183}],163:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(k,P.toMonthIndex(k,M,D),A)}else O=P.newDate(k,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(k),z.getUTCMonth()!==M||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,k=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":183}],175:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],176:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var T=e("./dom");function k(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var E=2e9;s.seedPseudoRandom=function(){E=2e9},s.pseudoRandom=function(){var e=E;return E=(69069*E+1)%4294967296,Math.abs(E-e)<429496729?s.pseudoRandom():E/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":156,"./anchor_utils":161,"./angles":162,"./array":163,"./clean_number":164,"./clear_responsive":166,"./coerce":167,"./dates":168,"./dom":169,"./extend":171,"./filter_unique":172,"./filter_visible":173,"./geometry2d":174,"./identity":175,"./is_plain_object":177,"./keyed_container":178,"./localize":179,"./loggers":180,"./make_trace_groups":181,"./matrix":182,"./mod":183,"./nested_property":184,"./noop":185,"./notifier":186,"./push_unique":189,"./regex":191,"./relative_attr":192,"./relink_private":193,"./search":194,"./stats":196,"./throttle":198,"./to_log_range":199,d3:14,"fast-isnumeric":16}],177:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],178:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":208,"./notifier":186}],181:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:14}],182:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],184:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":156,"./matrix":182}],189:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":163,"fast-isnumeric":16}],197:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,M){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void t();var s=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),M&&M.call(e,s),t(s)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):M[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],199:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":16}],200:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],201:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],202:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===D)E=L;else{for(z=Math.max(C.length,z),E=[],x=0;x=D);x++)E.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function q(e,t,r){if(e=o.getGraphDiv(e),T.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,q,[e,a.undoit],q,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[I];)I--;var R=z.parts[I],F=z.parts[I-1]+"."+R,H=z.parts.slice(0,I).join("."),j=l(e.layout,H).get(),q=l(s,H).get(),U=z.get();if(void 0!==E){k[D]=E,L[D]="reverse"===R?E:N(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var J="height"===D?"width":"height";S(J,s[J])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))P(F),l(s,H+"._inputRange").set(null);else if(F.match(Y)){P(F),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&l(s,H+"._inputDomain").set(null);if("type"===R){var K=j,ee="linear"===q.type&&"log"===E,te="log"===q.type&&"linear"===E;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(H+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(H+".range[0]",Math.log(re)/Math.LN10),S(H+".range[1]",Math.log(ne)/Math.LN10)):(S(H+".range[0]",Math.pow(10,re)),S(H+".range[1]",Math.pow(10,ne)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,E,S),u.getComponentMethod("images","convertCoords")(e,q,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var ae=l(s,D).get(),ie=(E||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=E,delete t[D]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(E))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,T.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":176,"../plots/attributes":217}],211:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(y(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,V,q,U,G,Z,Y=v._bgLayer.selectAll(".bg").data(M);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":176,"../plots/attributes":217,"../plots/plots":254,"./plot_config":208,"./plot_schema":209,"./plot_template":210}],213:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(k);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":176,"../plots/plots":254,"../snapshot/helpers":266,"../snapshot/svgtoimg":268,"../snapshot/tosvg":270,"../version":402,"./plot_api":207,"fast-isnumeric":16}],214:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(k);if(P&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,k[A].length):D);M++)L=P?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(T)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=k?[Math.max(0,C),Math.max(1,O)]:[C,O]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return T=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":156,"../../lib":176,"../../registry":262,"fast-isnumeric":16}],220:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,T=e("../../constants/alignment"),k=T.MID_SHIFT,M=T.CAP_SHIFT,A=T.LINE_SPACING,L=T.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),U(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Y(e.exponentformat)&&!X(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function G(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,R)):i>v?(t/=v,e.dtick="M"+q(t,1,F)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:B),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,F):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,R))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,R)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=q(t,r,V)):(e.tick0=0,r=n(10),e.dtick=q(t,r,R));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?j:H,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Y(p)&&X(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function Y(e){return"SI"===e||"B"===e}function X(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};U(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":Y(s)&&(e+=Z[c/3+5]));return i?_+e:e}function Q(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}X&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||X&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*k},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||T)for(r=0;rz&&RP&&(P=R);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,a,i)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function j(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function U(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(j(a),2!==e||he||je(),pe)i.indexOf("select")>-1&&M(r,a,W,Q,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?H:P,c="s"===g||"w"===O?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===O&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){ke="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(ke="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",q(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){ke="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",q(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":176,"fast-isnumeric":16}],238:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":152}],239:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,k=e("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,P=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function B(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function j(e,t,r){var n,i,o,l;for(n=0;n=0)Y._fullLayout._deactivateShape(Y);else if(!H){var r=X.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,Y,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&Y.emit("plotly_selected",void 0);l.click(Y,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),H&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":50,"../../components/dragelement/helpers":68,"../../components/drawing":72,"../../components/fx":90,"../../components/fx/helpers":86,"../../components/shapes/draw_newshape/display_outlines":135,"../../components/shapes/draw_newshape/helpers":136,"../../components/shapes/draw_newshape/newshapes":137,"../../lib":176,"../../lib/clear_gl_canvases":165,"../../lib/polygon":188,"../../lib/throttle":198,"../../plot_api/subroutines":211,"../../registry":262,"./axis_ids":223,"./constants":226,"./handle_outline":230,"./helpers":231,polybooljs:24}],240:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(e){return Math.pow(10,e)}function k(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(k(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var E=function(t){return a(t)?D(t,e._m,e._b):p},I=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var R="y"===f;E=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=R;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},I=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?T:c,e.l2p=E,e.p2l=I,e.c2p="log"===e.type?function(e,t){return E(M(e,t))}:E,e.p2c="log"===e.type?function(e){return T(I(e))}:I,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=I,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return T(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=T,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return T(I(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=I,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(I(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(I(e))},e.r2p=e.d2p,e.p2r=I,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,k=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":72,"../../lib":176,"../../registry":262,"./axes":220,d3:14}],245:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var N=!(!a._has||!a._has("gl2d")),B=!(!l._has||!l._has("gl2d")),H=!(!a._has||!a._has("cartesian"))||N,j=!(!l._has||!l._has("cartesian"))||B;H&&!j?a._bgLayer.remove():j&&!H&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),S(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var M in h){if(a(w)&&h[M].r){var A=h[M].r.val,L=h[M].r.size;if(A>_){var C=(w*A+(L-d)*_)/(A-_),O=(L*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(k)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>T){var z=(k*P+(D-p)*T)/(P-T),E=(D*(1-T)+(k-p)*(1-P))/(P-T);z>=0&&E>=0&&p-(E+z)>0&&z+E>f+u&&(f=z,u=E)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(D(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(E)}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 I,R=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();x=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var U=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(F),U.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));I.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!k){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":152,"../../../lib":176,d3:14}],259:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":50,"../../../lib":176,"./micropolar":258,"./undo_manager":260,d3:14}],260:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":50,"../components/drawing":72,"../constants/xmlns_namespaces":157,"../lib":176,d3:14}],271:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(T=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var P=g[e.index],D=v.base?P.b+P.s:P.s;e[f+"0"]=e[f+"1"]=C.c2p(P[f],!0),e[f+"LabelVal"]=D;var z=m.extents[m.extents.round(P.p)];return e[u+"0"]=S.c2p(y?T(P):z[0],!0),e[u+"1"]=S.c2p(y?k(P):z[1],!0),e[u+"LabelVal"]=P.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.spikeDistance=(L(P)+function(e){return M(_(e),w(e))}(P))/2-b,e[u+"Spike"]=S.c2p(P.p,!0),o(P,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":50,"../../components/fx":90,"../../constants/numerical":156,"../../lib":176,"../../plots/cartesian/axes":220,"../../registry":262,"./helpers":278}],280:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":233,"../scatter/marker_colorbar":381,"./arrays_to_calcdata":271,"./attributes":272,"./calc":273,"./cross_trace_calc":275,"./defaults":276,"./event_data":277,"./hover":279,"./layout_attributes":281,"./layout_defaults":282,"./plot":283,"./select":284,"./style":286}],281:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],282:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,B,I),B=G(B,N,I),H=G(H,j,!I),j=G(j,H,!I)}var Z=M(i.ensureSingle(D,"path"),P,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&R){var Y=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,Y,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function P(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var D=n[0].trace,z="h"===D.orientation,E=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(D,a);var I="stack"===v.mode||"relative"===v.mode,R=n[a],F=!I||R._outmost;if(!E||"none"===w||(R.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],D),H=h.getInsideTextFont(D,a,N,B),j=h.getOutsideTextFont(D,a,N),V=r.datum();z?"log"===T.type&&V.s0<=0&&(l=T.range[0]=G*(W/Z):W>=Z*(X/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){Y=i.ensureUniformFontSize(e,"outside"===w?j:H);var K=(q=P(r,E,Y)).attr("transform");if(q.attr("transform",""),U=s.bBox(q.node()),G=U.width,Z=U.height,q.attr("transform",K),G<=0||Z<=0)return void q.remove()}var ee,te,re=D.textangle;"outside"===w?(te="both"===D.constraintext||"outside"===D.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,M=0,A=l?k(t,e):k(r,n);l?(b=t-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re})):(te="both"===D.constraintext||"inside"===D.constraintext,ee=C(l,c,f,p,U,{isHorizontal:z,constrained:te,angle:re,anchor:D.insidetextanchor}));ee.fontSize=Y.size,d(D.type,ee,O),R.transform=ee,M(q,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,D,r,p,N,B,H,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,D.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,D,t,v)},toMoveInsideBar:C}},{"../../components/color":50,"../../components/drawing":72,"../../components/fx/helpers":86,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../registry":262,"./attributes":272,"./constants":274,"./helpers":278,"./style":286,"./uniform_text":288,d3:14,"fast-isnumeric":16}],284:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":50,"../../components/drawing":72,"../../lib":176,"../../registry":262,"./attributes":272,"./helpers":278,"./uniform_text":288,d3:14}],287:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61}],288:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var U=S.pointpos,G=S.jitter,Z=S.marker.size/2,Y=0;U+G>=0&&((Y=V*(U+G))>A?(q=!0,H=Z,N=Y):Y>R&&(H=Z,N=A)),Y<=A&&(N=A);var X=0;U-G<=0&&((X=-V*(U-G))>L?(q=!0,j=Z,B=X):X>F&&(j=Z,B=L)),X<=L&&(B=L)}else N=A,B=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.pos,c=t.val,u=i.bPos,f=i.bPosPxOffset||0,d=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var p=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(e){var t=s.c2l(e.pos+u,!0),a=s.l2p(t)+f,i=s.l2p(t-o)+f,p=s.l2p(t+l)+f,h=c.c2p(e.mean,!0),g=c.c2p(e.mean-e.sd,!0),v=c.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+h+","+i+"V"+p+("sd"===d?"m0,0L"+g+","+a+"L"+h+","+i+"L"+v+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+h+"H"+p+("sd"===d?"m0,0L"+a+","+g+"L"+i+","+h+"L"+a+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":72,"../../lib":176,d3:14}],294:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":50,"../../components/drawing":72,d3:14}],295:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../ohlc/attributes"),i=e("../box/attributes");function o(e){return{line:{color:n({},i.line.color,{dflt:e}),width:i.line.width,editType:"style"},fillcolor:i.fillcolor,editType:"style"}}t.exports={x:a.x,open:a.open,high:a.high,low:a.low,close:a.close,line:{width:n({},i.line.width,{}),editType:"style"},increasing:o(a.increasing.line.color.dflt),decreasing:o(a.decreasing.line.color.dflt),text:a.text,hovertext:a.hovertext,whiskerwidth:n({},i.whiskerwidth,{dflt:0}),hoverlabel:a.hoverlabel}},{"../../lib":176,"../box/attributes":289,"../ohlc/attributes":341}],296:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../ohlc/calc").calcCommon;function o(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,l=a.getFromId(e,t.xaxis),s=a.getFromId(e,t.yaxis),c=l.makeCalcdata(t,"x"),u=i(e,t,c,s,o);return u.length?(n.extendFlat(u[0].t,{num:r._numBoxes,dPos:n.distinctVals(c).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,u):[{t:{empty:!0}}]}},{"../../lib":176,"../../plots/cartesian/axes":220,"../ohlc/calc":342}],297:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("./attributes");function l(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function s(r,a){return n.coerce(e,t,o,r,a)}i(e,t,s,a)?(s("line.width"),l(e,t,s,"increasing"),l(e,t,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":50,"../../lib":176,"../ohlc/ohlc_defaults":346,"./attributes":295}],298:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":233,"../box/cross_trace_calc":290,"../box/layout_attributes":291,"../box/layout_defaults":292,"../box/plot":293,"../box/style":294,"../ohlc/hover":344,"../ohlc/select":348,"./attributes":295,"./calc":296,"./defaults":297}],299:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),l.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(c,f),[l]}}},{"../../components/color":50,"../../lib":176,"../bar/hover":279}],307:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"../bar/select":284,"./attributes":300,"./calc":301,"./cross_trace_calc":303,"./defaults":304,"./event_data":305,"./hover":306,"./layout_attributes":308,"./layout_defaults":309,"./plot":310,"./style":311}],308:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],309:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":50,"../../components/drawing":72,"../../constants/interactions":155,"../bar/style":286,"../bar/uniform_text":288,d3:14}],312:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":171,"../../plots/attributes":217,"../../plots/domain":247,"../../plots/template_attributes":261,"../pie/attributes":350}],313:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":254}],314:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":352}],315:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),f=c("values"),d=l(u,f),p=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,g=c("text"),v=c("texttemplate");if(v||(h=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),v||h&&"none"!==h){var m=c("textposition");o(e,t,s,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":176,"../../plots/domain":247,"../bar/defaults":276,"../pie/defaults":353,"./attributes":312}],316:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":361,"./attributes":312,"./base_plot":313,"./calc":314,"./defaults":315,"./layout_attributes":317,"./layout_defaults":318,"./plot":319,"./style":320}],317:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":357}],318:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":176,"./layout_attributes":317}],319:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../lib"),o=e("../../lib/svg_text_utils"),l=e("../bar/plot").toMoveInsideBar,s=e("../bar/uniform_text"),c=s.recordMinTextSize,u=s.clearMinTextSize,f=e("../pie/helpers"),d=e("../pie/plot"),p=d.attachFxHandlers,h=d.determineInsideTextFont,g=d.layoutAreas,v=d.prerenderTitles,m=d.positionTitleOutside,y=d.formatSliceLabel;function x(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;u("funnelarea",r),v(t,e),g(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var s=n.select(this),u=t[0],d=u.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var f,d,p=[];for(p.push(u()),f=e.length-1;f>-1;f--)if(!(d=e[f]).hidden){var h=d.v/s;c+=h,p.push(u())}var g=1/0,v=-1/0;for(f=0;f-1;f--)if(!(d=e[f]).hidden){var M=p[k+=1][0],A=p[k][1];d.TL=[-M,A],d.TR=[M,A],d.BL=w,d.BR=T,d.pxmid=(L=d.TR,S=d.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=d.TL,T=d.TR}var L,S}(t),s.each((function(){var s=n.select(this).selectAll("g.slice").data(t);s.enter().append("g").classed("slice",!0),s.exit().remove(),s.each((function(s,g){if(s.hidden)n.select(this).selectAll("path,g").remove();else{s.pointNumber=s.i,s.curveNumber=d.index;var v=u.cx,m=u.cy,b=n.select(this),_=b.selectAll("path.surface").data([s]);_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),b.call(p,e,t);var w="M"+(v+s.TR[0])+","+(m+s.TR[1])+x(s.TR,s.BR)+x(s.BR,s.BL)+x(s.BL,s.TL)+"Z";_.attr("d",w),y(e,s,u);var T=f.castOption(d.textposition,s.pts),k=b.selectAll("g.slicetext").data(s.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var u=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=i.ensureUniformFontSize(e,h(d,s,r.font));u.text(s.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,f).call(o.convertToTspans,e);var p,y,x,b=a.bBox(u.node()),_=Math.min(s.BL[1],s.BR[1])+m,w=Math.max(s.TL[1],s.TR[1])+m;y=Math.max(s.TL[0],s.BL[0])+v,x=Math.min(s.TR[0],s.BR[0])+v,(p=l(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,c(d.type,p,r),t[g].transform=p,u.attr("transform",i.getTextTransform(p))}))}}));var g=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),l=d.title.text;d._meta&&(l=i.templateString(l,d._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,d.title.font).call(o.convertToTspans,e);var s=m(u,r._size);t.attr("transform","translate("+s.x+","+s.y+")"+(s.scale<1?"scale("+s.scale+")":"")+"translate("+s.tx+","+s.ty+")")}))}))}))}},{"../../components/drawing":72,"../../lib":176,"../../lib/svg_text_utils":197,"../bar/plot":283,"../bar/uniform_text":288,"../pie/helpers":355,"../pie/plot":359,d3:14}],320:[function(e,t,r){"use strict";var n=e("d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":288,"../pie/style_one":361,d3:14}],321:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("./bin_attributes"),o=e("./constants"),l=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":171,"../../plots/template_attributes":261,"../bar/attributes":272,"./bin_attributes":323,"./constants":327}],322:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&mo){var y=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(N)&&(H=o.tickIncrement(H,b.size,!0,p)),E.start=r.l2r(H),F||a.nestedProperty(t,m+".start").set(E.start)}var j=b.end,V=r.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(j)){var U=q?V:a.aggNums(Math.max,null,h);E.end=r.l2r(U),q||a.nestedProperty(t,m+".start").set(E.end)}var G="autobin"+l;return!1===t._input[G]&&(t._input[m]=a.extendFlat({},t[m]||{}),delete t._input[G],delete t[G]),[E,h]}t.exports={calc:function(e,t){var r,i,p,h,g=[],v=[],m=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),y="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[y],b=t[y+"calendar"],_=t.cumulative,w=d(e,t,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],P=0,D=t.histnorm,z=t.histfunc,E=-1!==D.indexOf("density");_.enabled&&E&&(D=D.replace(/ ?density$/,""),E=!1);var I,R="max"===z||"min"===z?null:0,F=s.count,N=c[D],B=!1,H=function(e){return m.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==z&&(I=t[x],B="avg"===z,F=s[z]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),J=[],$=0,K=Q-1;for(r=0;r=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var ee={p:g[r],s:v[r],b:0};_.enabled||(ee.pts=O[r],G?ee.ph0=ee.ph1=O[r].length?k[O[r][0]]:g[r]:(t._computePh=!0,ee.ph0=q(A[r]),ee.ph1=q(A[r+1],!0))),J.push(ee)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),l(J,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(J,t,X),J},calcAllAutoBins:d}},{"../../lib":176,"../../plots/cartesian/axes":220,"../../registry":262,"../bar/arrays_to_calcdata":271,"./average":322,"./bin_functions":324,"./bin_label_vals":325,"./norm_functions":333,"fast-isnumeric":16}],327:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],328:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,g,v,m=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function x(e){e.each((function(e){h.stroke(n.select(this),e.line.color)})).each((function(e){h.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function b(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return a.coerce(i,o,p,e,t)}return f(i,o,s,l,n),d(i,o,s,l),o}function _(e,t){return"translate("+e+","+t+")"}function w(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function T(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(c.convertToTspans,a).call(l.font,t),l.bBox(o.node())}function k(e,t,r,n,i,o){var l="_cache"+t;e[l]&&e[l].key===i||(e[l]={key:i,value:r});var s=a.aggNums(o,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,f){var d,p=e._fullLayout;y(r)&&f&&(d=f()),a.makeTraceGroups(p._indicatorlayer,t,"trace").each((function(t){var f,M,A,L,S,C=t[0].trace,O=n.select(this),P=C._hasGauge,D=C._isAngular,z=C._isBullet,E=C.domain,I={w:p._size.w*(E.x[1]-E.x[0]),h:p._size.h*(E.y[1]-E.y[0]),l:p._size.l+p._size.w*E.x[0],r:p._size.r+p._size.w*(1-E.x[1]),t:p._size.t+p._size.h*(1-E.y[1]),b:p._size.b+p._size.h*E.y[0]},R=I.l+I.w/2,F=I.t+I.h/2,N=Math.min(I.w/2,I.h),B=s.innerRadius*N,H=C.align||"center";if(M=F,P){if(D&&(f=R,M=F+N/2,A=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*B)}),z){var j=s.bulletPadding,V=1-s.bulletNumberDomainSize+j;f=I.l+(V+(1-V)*v[H])*I.w,A=function(e){return w(e,(s.bulletNumberDomainSize-j)*I.w,I.h)}}}else f=I.l+v[H]*I.w,A=function(e){return w(e,I.w,I.h)};!function(e,t,r,i){var o,s,f,d=r[0].trace,p=i.numbersX,x=i.numbersY,w=d.align||"center",M=g[w],A=i.transitionOpts,L=i.onComplete,S=a.ensureSingle(t,"g","numbers"),C=[];d._hasNumber&&C.push("number");d._hasDelta&&(C.push("delta"),"left"===d.delta.position&&C.reverse());var O=S.selectAll("text").data(C);function P(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(m)||r(a).slice(-1).match(m))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=b(e,{tickformat:i});return function(e){return Math.abs(e)<1?u.tickText(o,e).text:r(e)}}O.enter().append("text"),O.attr("text-anchor",(function(){return M})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),O.exit().remove();var D,z=d.mode+d.align;d._hasDelta&&(D=function(){var t=b(e,{tickformat:d.delta.valueformat},d._range);t.setScale(),u.prepTicks(t);var a=function(e){return u.tickText(t,e).text},i=function(e){return d.delta.relative?e.relativeDelta:e.delta},o=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?d.delta.increasing.symbol:d.delta.decreasing.symbol)+t(e)},f=function(e){return e.delta>=0?d.delta.increasing.color:d.delta.decreasing.color};void 0===d._deltaLastValue&&(d._deltaLastValue=i(r[0]));var p=S.select("text.delta");function g(){p.text(o(i(r[0]),a)).call(h.fill,f(r[0])).call(c.convertToTspans,e)}return p.call(l.font,d.delta.font).call(h.fill,f({delta:d._deltaLastValue})),y(A)?p.transition().duration(A.duration).ease(A.easing).tween("text",(function(){var e=n.select(this),t=i(r[0]),l=d._deltaLastValue,s=P(d.delta.valueformat,a,l,t),c=n.interpolateNumber(l,t);return d._deltaLastValue=t,function(t){e.text(o(c(t),s)),e.call(h.fill,f({delta:c(t)}))}})).each("end",(function(){g(),L&&L()})).each("interrupt",(function(){g(),L&&L()})):g(),s=T(o(i(r[0]),a),d.delta.font,M,e),p}(),z+=d.delta.position+d.delta.font.size+d.delta.font.family+d.delta.valueformat,z+=d.delta.increasing.symbol+d.delta.decreasing.symbol,f=s);d._hasNumber&&(!function(){var t=b(e,{tickformat:d.number.valueformat},d._range);t.setScale(),u.prepTicks(t);var a=function(e){return u.tickText(t,e).text},i=d.number.suffix,s=d.number.prefix,f=S.select("text.number");function p(){var t="number"==typeof r[0].y?s+a(r[0].y)+i:"-";f.text(t).call(l.font,d.number.font).call(c.convertToTspans,e)}y(A)?f.transition().duration(A.duration).ease(A.easing).each("end",(function(){p(),L&&L()})).each("interrupt",(function(){p(),L&&L()})).attrTween("text",(function(){var e=n.select(this),t=n.interpolateNumber(r[0].lastY,r[0].y);d._lastValue=r[0].y;var o=P(d.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(s+o(t(r))+i)}})):p(),o=T(s+a(r[0].y)+i,d.number.font,M,e)}(),z+=d.number.font.size+d.number.font.family+d.number.valueformat+d.number.suffix+d.number.prefix,f=o);if(d._hasDelta&&d._hasNumber){var E,I,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(s.left+s.right)/2,(s.top+s.bottom)/2],N=.75*d.delta.font.size;"left"===d.delta.position&&(E=k(d,"deltaPos",0,-1*(o.width*v[d.align]+s.width*(1-v[d.align])+N),z,Math.min),I=R[1]-F[1],f={width:o.width+s.width+N,height:Math.max(o.height,s.height),left:s.left+E,right:o.right,top:Math.min(o.top,s.top+I),bottom:Math.max(o.bottom,s.bottom+I)}),"right"===d.delta.position&&(E=k(d,"deltaPos",0,o.width*(1-v[d.align])+s.width*v[d.align]+N,z,Math.max),I=R[1]-F[1],f={width:o.width+s.width+N,height:Math.max(o.height,s.height),left:o.left,right:s.right+E,top:Math.min(o.top,s.top+I),bottom:Math.max(o.bottom,s.bottom+I)}),"bottom"===d.delta.position&&(E=null,I=s.height,f={width:Math.max(o.width,s.width),height:o.height+s.height,left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),top:o.bottom-o.height,bottom:o.bottom+s.height}),"top"===d.delta.position&&(E=null,I=o.top,f={width:Math.max(o.width,s.width),height:o.height+s.height,left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),top:o.bottom-o.height-s.height,bottom:o.bottom}),D.attr({dx:E,dy:I})}(d._hasNumber||d._hasDelta)&&S.attr("transform",(function(){var e=i.numbersScaler(f);z+=e[2];var t,r=k(d,"numbersScale",1,e[0],z,Math.min);d._scaleNumbers||(r=1),t=d._isAngular?x-r*f.bottom:x-r*(f.top+f.bottom)/2,d._numbersTop=r*f.top+t;var n=f[w];"center"===w&&(n=(f.left+f.right)/2);var a=p-r*n;return _(a=k(d,"numbersTranslate",0,a,z,Math.max),t)+" scale("+r+")"}))}(e,O,t,{numbersX:f,numbersY:M,numbersScaler:A,transitionOpts:r,onComplete:d}),P&&(L={range:C.gauge.axis.range,color:C.gauge.bgcolor,line:{color:C.gauge.bordercolor,width:0},thickness:1},S={range:C.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:C.gauge.bordercolor,width:C.gauge.borderwidth},thickness:1});var q=O.selectAll("g.angular").data(D?t:[]);q.exit().remove();var U=O.selectAll("g.angularaxis").data(D?t:[]);U.exit().remove(),D&&function(e,t,r,a){var l,s,c,f,d=r[0].trace,p=a.size,h=a.radius,g=a.innerRadius,v=a.gaugeBg,m=a.gaugeOutline,w=[p.l+p.w/2,p.t+p.h/2+h/2],T=a.gauge,k=a.layer,M=a.transitionOpts,A=a.onComplete,L=Math.PI/2;function S(e){var t=d.gauge.axis.range[0],r=(e-t)/(d.gauge.axis.range[1]-t)*Math.PI-L;return r<-L?-L:r>L?L:r}function C(e){return n.svg.arc().innerRadius((g+h)/2-e/2*(h-g)).outerRadius((g+h)/2+e/2*(h-g)).startAngle(-L)}function O(e){e.attr("d",(function(e){return C(e.thickness).startAngle(S(e.range[0])).endAngle(S(e.range[1]))()}))}T.enter().append("g").classed("angular",!0),T.attr("transform",_(w[0],w[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(l=b(e,d.gauge.axis)).type="linear",l.range=d.gauge.axis.range,l._id="xangularaxis",l.setScale();var P=function(e){return(l.range[0]-e.x)/(l.range[1]-l.range[0])*Math.PI+Math.PI},D={},z=u.makeLabelFns(l,0).labelStandoff;D.xFn=function(e){var t=P(e);return Math.cos(t)*z},D.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(z+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*o)},D.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},D.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var E=function(e){return _(w[0]+h*Math.cos(e),w[1]-h*Math.sin(e))};c=function(e){return E(P(e))};if(s=u.calcTicks(l),f=u.getTickSigns(l)[2],l.visible){f="inside"===l.ticks?-1:1;var I=(l.linewidth||1)/2;u.drawTicks(e,l,{vals:s,layer:k,path:"M"+f*I+",0h"+f*l.ticklen,transFn:function(e){var t=P(e);return E(t)+"rotate("+-i(t)+")"}}),u.drawLabels(e,l,{vals:s,layer:k,transFn:c,labelFns:D})}var R=[v].concat(d.gauge.steps),F=T.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(O).call(x),F.exit().remove();var N=C(d.gauge.bar.thickness),B=T.selectAll("g.value-arc").data([d.gauge.bar]);B.enter().append("g").classed("value-arc",!0).append("path");var H=B.select("path");y(M)?(H.transition().duration(M.duration).ease(M.easing).each("end",(function(){A&&A()})).each("interrupt",(function(){A&&A()})).attrTween("d",(j=N,V=S(r[0].lastY),q=S(r[0].y),function(){var e=n.interpolate(V,q);return function(t){return j.endAngle(e(t))()}})),d._lastValue=r[0].y):H.attr("d","number"==typeof r[0].y?N.endAngle(S(r[0].y)):"M0,0Z");var j,V,q;H.call(x),B.exit().remove(),R=[];var U=d.gauge.threshold.value;U&&R.push({range:[U,U],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var G=T.selectAll("g.threshold-arc").data(R);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(O).call(x),G.exit().remove();var Z=T.selectAll("g.gauge-outline").data([m]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(O).call(x),Z.exit().remove()}(e,0,t,{radius:N,innerRadius:B,gauge:q,layer:U,size:I,gaugeBg:L,gaugeOutline:S,transitionOpts:r,onComplete:d});var G=O.selectAll("g.bullet").data(z?t:[]);G.exit().remove();var Z=O.selectAll("g.bulletaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,n){var a,i,o,l,c,f=r[0].trace,d=n.gauge,p=n.layer,g=n.gaugeBg,v=n.gaugeOutline,m=n.size,_=f.domain,w=n.transitionOpts,T=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform","translate("+m.l+", "+m.t+")"),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=m.h,M=f.gauge.bar.thickness*k,A=_.x[0],L=_.x[0]+(_.x[1]-_.x[0])*(f._hasNumber||f._hasDelta?1-s.bulletNumberDomainSize:1);(a=b(e,f.gauge.axis))._id="xbulletaxis",a.domain=[A,L],a.setScale(),i=u.calcTicks(a),o=u.makeTransFn(a),l=u.getTickSigns(a)[2],c=m.t+m.h,a.visible&&(u.drawTicks(e,a,{vals:"inside"===a.ticks?u.clipEnds(a,i):i,layer:p,path:u.makeTickPath(a,c,l),transFn:o}),u.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:u.makeLabelFns(a,c)}));function S(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var C=[g].concat(f.gauge.steps),O=d.selectAll("g.bg-bullet").data(C);O.enter().append("g").classed("bg-bullet",!0).append("rect"),O.select("rect").call(S).call(x),O.exit().remove();var P=d.selectAll("g.value-bullet").data([f.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(k-M)/2).call(x),y(w)?P.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){T&&T()})).each("interrupt",(function(){T&&T()})).attr("width",Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var D=r.filter((function(){return f.gauge.threshold.value})),z=d.selectAll("g.threshold-bullet").data(D);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",a.c2p(f.gauge.threshold.value)).attr("x2",a.c2p(f.gauge.threshold.value)).attr("y1",(1-f.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-f.gauge.threshold.thickness)/2)*k).call(h.stroke,f.gauge.threshold.line.color).style("stroke-width",f.gauge.threshold.line.width),z.exit().remove();var E=d.selectAll("g.gauge-outline").data([v]);E.enter().append("g").classed("gauge-outline",!0).append("rect"),E.select("rect").call(S).call(x),E.exit().remove()}(e,0,t,{gauge:G,layer:Z,size:I,gaugeBg:L,gaugeOutline:S,transitionOpts:r,onComplete:d});var Y=O.selectAll("text.title").data(t);Y.exit().remove(),Y.enter().append("text").classed("title",!0),Y.attr("text-anchor",(function(){return z?g.right:g[C.title.align]})).text(C.title.text).call(l.font,C.title.font).call(c.convertToTspans,e),Y.attr("transform",(function(){var e,t=I.l+I.w*v[C.title.align],r=s.titlePadding,n=l.bBox(Y.node());if(P){if(D)if(C.gauge.axis.visible)e=l.bBox(U.node()).top-r-n.bottom;else e=I.t+I.h/2-N/2-n.bottom-r;z&&(e=M-(n.top+n.bottom)/2,t=I.l-s.bulletPadding*I.w)}else e=C._numbersTop-r-n.bottom;return _(t,e)}))}))}},{"../../components/color":50,"../../components/drawing":72,"../../constants/alignment":152,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/cartesian/axes":220,"../../plots/cartesian/axis_defaults":222,"../../plots/cartesian/layout_attributes":234,"../../plots/cartesian/position_defaults":237,"./constants":337,d3:14}],341:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../components/fx/attributes"),l=e("../../constants/delta.js"),s=l.INCREASING.COLOR,c=l.DECREASING.COLOR,u=a.line;function f(e){return{line:{color:n({},u.color,{dflt:e}),width:u.width,dash:i,editType:"style"},editType:"style"}}t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},u.width,{}),dash:n({},i,{}),editType:"style"},increasing:f(s),decreasing:f(c),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":71,"../../components/fx/attributes":81,"../../constants/delta.js":153,"../../lib":176,"../scatter/attributes":363}],342:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../constants/numerical").BADNUM;function l(e,t,r,n){return{o:e,h:t,l:r,c:n}}function s(e,t,r,l,s){for(var c=l.makeCalcdata(t,"open"),u=l.makeCalcdata(t,"high"),f=l.makeCalcdata(t,"low"),d=l.makeCalcdata(t,"close"),p=Array.isArray(t.text),h=Array.isArray(t.hovertext),g=!0,v=null,m=[],y=0;yv):g=T>b,v=T;var k=s(b,_,w,T);k.pos=x,k.yc=(b+T)/2,k.i=y,k.dir=g?"increasing":"decreasing",k.x=k.pos,k.y=[w,_],p&&(k.tx=t.text[y]),h&&(k.htx=t.hovertext[y]),m.push(k)}else m.push({pos:x,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,n.concat(f,u),{padded:!0}),m.length&&(m[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),m}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),o=function(e,t,r){var a=r._minDiff;if(!a){var i,o=e._fullData,l=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b):((y=a.extendFlat({},d)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(l,b),y.name="",f.push(y),v[b]=y)}return f}function d(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,f=i[0].t,d=u(e,t,r,a);if(!d)return[];var p=i[d.index],h=d.index=p.i,g=p.dir;function v(e){return f.labels[e]+n.hoverLabelText(o,s[e][h])}var m=p.hi||s.hoverinfo,y=m.split("+"),x="all"===m,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[v("open"),v("high"),v("low"),v("close")+" "+c[g]]:[];return _&&l(p,s,w),d.extraText=w.join("
"),d.y0=d.y1=o.c2p(p.yc,!0),[d]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):d(e,t,r,n)},hoverSplit:f,hoverOnPoints:d}},{"../../components/color":50,"../../components/fx":90,"../../constants/delta.js":153,"../../lib":176,"../../plots/cartesian/axes":220}],345:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":233,"./attributes":341,"./calc":342,"./defaults":343,"./hover":344,"./plot":347,"./select":348,"./style":349}],346:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var f=Math.min(l.length,s.length,c.length,u.length);return o&&(f=Math.min(f,a.minRowLength(o))),t._length=f,f}}},{"../../lib":176,"../../registry":262}],347:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.xaxis,l=t.yaxis;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var s=i.tickLen,c=t.selectAll("path").data(a.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=o.c2p(e.pos,!0),r=o.c2p(e.pos-s,!0),n=o.c2p(e.pos+s,!0);return"M"+r+","+l.c2p(e.o,!0)+"H"+t+"M"+t+","+l.c2p(e.h,!0)+"V"+l.c2p(e.l,!0)+"M"+n+","+l.c2p(e.c,!0)+"H"+t}))}}))}},{"../../lib":176,d3:14}],348:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":176,"../../plots/domain":247,"../bar/defaults":276,"./attributes":350,"fast-isnumeric":16}],354:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":86}],355:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castOption(b.bgcolor,e.pts)||e.color,borderColor:h.castOption(b.bordercolor,e.pts),fontFamily:h.castOption(_.family,e.pts),fontSize:h.castOption(_.size,e.pts),fontColor:h.castOption(_.color,e.pts),nameLength:h.castOption(b.namelength,e.pts),textAlign:h.castOption(b.align,e.pts),hovertemplate:h.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function y(e,t,r){var n=h.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=h.castOption(e._input.textfont.color,t.pts));var a=h.castOption(e.insidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.insidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function x(e,t){for(var r,n,a=0;at&&t>n||r=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=_(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=w(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.width/e.height,o=M(i,n,t,r);return{scale:2*o/e.height,rCenter:T(i,o/t),rotate:k(a)}}function w(e,t,r,n,a){t=Math.max(0,t-2*p);var i=e.height/e.width,o=M(i,n,t,r);return{scale:2*o/e.width,rCenter:T(i,o/t),rotate:k(a+Math.PI/2)}}function T(e,t){return Math.cos(t)-e*t}function k(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function A(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function S(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function O(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:h.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:h.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=h.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function E(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;d("pie",r),x(t,e),P(t,i);var u=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],p=d.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=o.rotation*Math.PI/180,s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=A(r,a))}(t),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,u=d.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(m,e,t),p.pull){var w=+h.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===d.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}z(e,a,d);var S=h.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),v=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=h.castOption(e.outsidetextfont.color,t.pts)||h.castOption(e.textfont.color,t.pts)||r.color,a=h.castOption(e.outsidetextfont.family,t.pts)||h.castOption(e.textfont.family,t.pts)||r.family,i=h.castOption(e.outsidetextfont.size,t.pts)||h.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,v).call(c.convertToTspans,e);var m,_=l.bBox(g.node());if("outside"===S)m=L(_,a);else if(m=b(_,a,d),"auto"===S&&m.scale<1){var w=s.ensureUniformFontSize(e,p.outsidetextfont);g.call(l.font,w),m=L(_=l.bBox(g.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:D(d.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=u+k[1]*m.rCenter+(m.y||0),E(m,_),m.outside){var M=m.targetY;a.yLabelMin=M-_.height/2,a.yLabelMid=M,a.yLabelMax=M+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}m.fontSize=v.size,f(p.type,m,r),t[i].transform=m,g.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,p.title.font).call(c.convertToTspans,e),t="middle center"===p.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(d):S(d,i),r.attr("transform","translate("+t.x+","+t.y+")"+(t.scale<1?"scale("+t.scale+")":"")+"translate("+t.tx+","+t.ty+")")})),x&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,g;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-g;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(h.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=l.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),M=i.h*(T.y[1]-T.y[0]),A=(.5*k-d.r)/i.w,C=(.5*M-d.r)/i.h;a.autoMargin(e,"pie."+p.uid+".automargin",{xl:T.x[0]-A,xr:T.x[1]+A,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(d.cx-d.r-w.left,0),r:Math.max(w.right-(d.cx+d.r),0),b:Math.max(w.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:S,prerenderTitles:x,layoutAreas:P,attachFxHandlers:m,computeTransform:E}},{"../../components/color":50,"../../components/drawing":72,"../../components/fx":90,"../../lib":176,"../../lib/svg_text_utils":197,"../../plots/plots":254,"../bar/constants":274,"../bar/uniform_text":288,"./event_data":354,"./helpers":355,d3:14}],360:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":288,"./style_one":361,d3:14}],361:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":50,"./helpers":355}],362:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rl&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],370:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mG!=(F=D[O][1])>=G&&(E=D[O-1][0],I=D[O][0],F-R&&(z=E+(I-E)*(G-R)/(F-R),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,0),V=Math.min(V,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":50,"../../components/fx":90,"../../lib":176,"../../registry":262,"./get_trace_color":373}],375:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"./arrays_to_calcdata":362,"./attributes":363,"./calc":364,"./cross_trace_calc":368,"./cross_trace_defaults":369,"./defaults":370,"./format_labels":372,"./hover":374,"./marker_colorbar":381,"./plot":383,"./select":384,"./style":386,"./subtypes":387}],376:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"../../lib":176}],377:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,E=t.baseTolerance,I=t.shape,R="linear"===I,F=t.fill&&"none"!==t.fill,N=[],B=f.minTolerance,H=e.length,j=new Array(H),V=0;function q(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),J=null,W=Q=0}function fe(e){if(M=e[0]/P,A=e[1]/D,Y=e[0]re?re:0,X=e[1]ae?ae:0,Y||X){if(V)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else $=K(j[V-1],e)[0],j[V++]=$;else j[V++]=[Y||e[0],X||e[1]];var r=j[V-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Q!==X?ce(W&&Q?(n=J,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,Q||X]):W&&Q&&ce([W,Q])),ce([Y,X])):W-Y&&Q-X&&ce([Y||W,X||Q]),J=e,W=Y,Q=X}else J&&ue(K(J,e)[0]),j[V++]=e;var n,a,i,o}for("linear"===I||"spline"===I?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}J&&ce([W||J[0],Q||J[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":156,"../../lib":176,"./constants":367}],378:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],379:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":16}],381:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],382:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"./subtypes":387}],383:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,D,z="",E=[],I=_._prevtrace;I&&(z=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,V,q="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var Y=M.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+q.substr(1)).call(s.singleFillStyle)):y(S).attr("d",q+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=V):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var T,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function J(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":72,"../../lib":176,"../../lib/polygon":188,"../../registry":262,"./line_points":377,"./link_traces":379,"./subtypes":387,d3:14}],384:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,h),[c]}function w(e){return n(p,e)}}},{"../../components/color":50,"../../constants/delta.js":153,"../../plots/cartesian/axes":220,"../bar/hover":279}],397:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":233,"../bar/select":284,"./attributes":390,"./calc":391,"./cross_trace_calc":393,"./defaults":394,"./event_data":395,"./hover":396,"./layout_attributes":398,"./layout_defaults":399,"./plot":400,"./style":401}],398:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],399:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(v+=d?"M"+f[0]+","+h[1]+"V"+h[0]:"M"+f[1]+","+h[0]+"H"+f[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":50,"../../components/drawing":72,"../../constants/interactions":155,"../bar/style":286,"../bar/uniform_text":288,d3:14}],402:[function(e,t,r){"use strict";r.version="1.54.3"},{}]},{},[8])(8)})); \ No newline at end of file diff --git a/dist/plotly-geo-assets.js b/dist/plotly-geo-assets.js index 867c1ec3091..837cbee911e 100644 --- a/dist/plotly-geo-assets.js +++ b/dist/plotly-geo-assets.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.54.2 +* plotly.js v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -84,7 +84,7 @@ exports.topojson = saneTopojson; 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[16])(16) }); diff --git a/dist/plotly-geo.js b/dist/plotly-geo.js index 52727e92c48..34b5bee3791 100644 --- a/dist/plotly-geo.js +++ b/dist/plotly-geo.js @@ -1,5 +1,5 @@ /** -* plotly.js (geo) v1.54.2 +* plotly.js (geo) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -71182,6 +71182,15 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { )(layoutIn, layoutOut, coerce); }; +function getComputedSize(attr) { + return ( + (typeof attr === 'string') && + (attr.substr(attr.length - 2) === 'px') && + parseFloat(attr) + ); +} + + plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { var context = gd._context || {}; var frameMargins = context.frameMargins; @@ -71208,8 +71217,8 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { // but don't enforce any ratio restrictions var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {}; - newWidth = parseFloat(computedStyle.width) || parseFloat(computedStyle.maxWidth) || fullLayout.width; - newHeight = parseFloat(computedStyle.height) || parseFloat(computedStyle.maxHeight) || fullLayout.height; + newWidth = getComputedSize(computedStyle.width) || getComputedSize(computedStyle.maxWidth) || fullLayout.width; + newHeight = getComputedSize(computedStyle.height) || getComputedSize(computedStyle.maxHeight) || fullLayout.height; if(isNumeric(frameMargins) && frameMargins > 0) { var factor = 1 - 2 * frameMargins; @@ -80652,7 +80661,7 @@ function styleTrace(gd, calcTrace) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[4])(4) }); diff --git a/dist/plotly-geo.min.js b/dist/plotly-geo.min.js index 27a68b99a9c..789373d87c7 100644 --- a/dist/plotly-geo.min.js +++ b/dist/plotly-geo.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (geo - minified) v1.54.2 +* plotly.js (geo - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -18,4 +18,4 @@ * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":24,"./lib/epsilon":25,"./lib/geojson":26,"./lib/intersecter":27,"./lib/segment-chainer":29,"./lib/segment-selector":30}],24:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],25:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],26:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(E(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function O(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function E(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],33:[function(e,t,r){!function(e,n){"object"==typeof r&&"undefined"!=typeof t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,V=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(G=!0):G=!0),Y=te._offset+te.r2p(t[$]),J=.5}else"x"===$?(W=t[$],Y=b.l+b.w*W):(W=1-t[$],Y=b.t+b.h*W),J=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+$];Q=ne*H(.5,t.xanchor)-ae*H(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=Q):(se.tail=Y+ue,X=Q+ue),se.text=se.tail+Q;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=Q=ie*H(J,oe),se.text=Y+Q;se.text+=le,Q+=le,X+=le,t["_"+$+"padplus"]=ie/2+X,t["_"+$+"padminus"]=ie/2-X,t["_"+$+"size"]=ie,t["_"+$+"shift"]=Q}if(G)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,F?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;q.call(f.positionText,me,ve).call(c.setClipUrl,F?A:null,e)}j.select("rect").call(c.setRect,I,I,w,D),N.call(c.setRect,R/2,R/2,E-R,B-R),z.call(c.setTranslate,Math.round(L.x.text-E/2),Math.round(L.y.text-B/2)),P.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),O=+N.attr("width"),D=+N.attr("height"),R=m-.5*O,E=R+O,I=y-.5*D,F=I+D,j=[[R,I,R,F],[R,F,E,F],[E,F,E,I],[E,I,R,I]].map(A);if(!j.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){j.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var B=t.arrowwidth,H=t.arrowcolor,q=t.arrowside,U=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),G=U.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",B+"px").call(s.stroke,s.rgb(H));if(g(G,q,t),_.annotationPosition&&G.node().parentNode&&!i){var V=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));V+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,J=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(h-Z),transform:"translate("+V+","+Z+")"}).style("stroke-width",B+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),M("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),M("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&M("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&M("ay",v.p2r(v.r2p(t.ay)+r)),U.attr("transform","translate("+e+","+r+")"),P.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),O)p.init({element:z.node(),gd:e,prepFn:function(){ye=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?M("ax",l.p2r(l.r2p(t.ax)+e)):M("ax",t.ax+e),t.ayref===t.yref?M("ay",v.p2r(v.r2p(t.ay)+r)):M("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}M("x",a),M("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}P.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",U(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void O();if(m){if(m*m>x*x+b*b)return void O();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void O();var k=y*Math.cos(s),M=y*Math.sin(s);o.x-=k,o.y-=M,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var T=u.getTotalLength(),A="";if(T1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":260,"../annotations/draw":41}],48:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(V.tick0=0)}V.dtick=Z}V.domain=[q+j,q+I-j],V.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var J,Q=e.select("."+M.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+M.cbaxis),K=0;function ee(n,a){var i={propContainer:V,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var e,r=s.l+(t.x+N)*s.w,n=V.title.font.size;e="top"===T?(1-(q+I-j))*s.h+s.t+3+.75*n:(1-(q+j))*s.h+s.t-3-.25*n,ee(V._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=e.select("."+M.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+V._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===T)V.domain[1]-=K/s.h,u[1]*=-1;else{V.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),V.setScale()}}e.selectAll("."+M.cbfills+",."+M.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-V.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+M.cbfills).selectAll("rect."+M.cbfill).data(O);m.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(V.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(O[i]+O[i-1])/2,i===O.length-1?A[1]:(O[i]+O[i+1])/2].map(V.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:B,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+M.cblines).selectAll("path."+M.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(V.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+V._id+"tick,path").remove();var b=B+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(V),k=l.makeTransFn(V),C=l.getTickSigns(V)[2];return l.drawTicks(r,V,{vals:"inside"===V.ticks?l.clipEnds(V,w):w,layer:$,path:l.makeTickPath(V,b,C),transFn:k}),l.drawLabels(r,V,{vals:w,layer:$,transFn:k,labelFns:l.makeLabelFns(V,b)})},function(){if(-1===["top","bottom"].indexOf(T)){var e=V.title.font.size,t=V._offset+V._length/2,a=s.l+(V.position||0)*s.w+("right"===V.side?10+e*(V.showticklabels?1:.5):-10-e*(V.showticklabels?.5:0));ee("h"+V._id+"title",{avoid:{selection:n.select(r).selectAll("g."+V._id+"tick"),side:T,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((J=Q.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=Q.select(".h"+V._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?d.bBox(o).width:d.bBox(Q.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-G;e.select("."+M.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:G-F,width:Math.max(l,2),height:Math.max(c+2*F,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+M.cboutline).attr({x:B,y:G+t.ypad+("top"===T?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":152,"../../lib":177,"../../lib/extend":170,"../../lib/setcursor":196,"../../lib/svg_text_utils":198,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":263,"../../registry":272,"../color":50,"../colorscale/helpers":61,"../dragelement":69,"../drawing":72,"../titles":145,"./constants":52,d3:13,tinycolor2:32}],55:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":177}],56:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":51,"./defaults":53,"./draw":54,"./has_colorbar":55}],57:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":192,"../colorbar/attributes":51,"./scales.js":65}],58:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":177,"./helpers":61,"fast-isnumeric":15}],59:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],67:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":177}],68:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],69:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":177,"../../plots/cartesian/constants":228,"./align":66,"./cursor":67,"./unhover":70,"has-hover":17,"has-passive-events":18,"mouse-event-offset":21}],70:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":168,"../../lib/events":169,"../../lib/throttle":199,"../fx/constants":84}],71:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],72:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],M[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var R=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(R,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var E=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(E);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":86,"../../constants/alignment":152,"../../constants/interactions":154,"../../constants/xmlns_namespaces":156,"../../lib":177,"../../lib/svg_text_utils":198,"../../registry":272,"../../traces/scatter/make_bubble_size_func":311,"../../traces/scatter/subtypes":318,"../color":50,"../colorscale":62,"./symbol_defs":73,d3:13,"fast-isnumeric":15,tinycolor2:32}],73:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:13}],74:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],75:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":318,"../drawing":72,d3:13,"fast-isnumeric":15}],80:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":50,d3:13}],81:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":170,"../../plots/font_attributes":250,"./layout_attributes":91}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,R="xval"in t?g.flat(s,t.xval):g.p2c(b,K),E="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(R[0])||!a(E[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(N=0;NZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==X&&0===W.length){V.distance=X,V.index=!1;var d=j._module.hoverPoints(V,U,G,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=X}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>p.spikeDistance)&&(Q.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>p.spikeDistance)&&(Q.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Te=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:Me,bgColor:Te,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Le,Me?"xa":"ya",u),P(Le,Me));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:R,yvals:E})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",P=w[S],O=(String(P)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,R=D.width,E=D.height,I=void 0!==P&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var N,F,j=!0;for(N=0;Na.width-S?(m=a.width-S,l.attr("d","M"+(S-M)+",0L"+S+","+A+M+"v"+A+(2*T+x.height)+"H-"+S+"V"+A+M+"H"+(S-2*M)+"Z")):l.attr("d","M0,0L"+M+","+A+M+"H"+(T+x.width/2)+"v"+A+(2*T+x.height)+"H-"+(T+x.width/2)+"V"+A+M+"H-"+M+"Z")}else{var C,O,D;"right"===L.side?(C="start",O=1,D="",m=k._offset+k._length):(C="end",O=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+M+","+M+"V"+(T+x.height/2)+"h"+D+(2*T+x.width)+"V-"+(T+x.height/2)+"H"+D+M+"V-"+M+"Z");var R,E=x.height/2,I=z-x.top-E,N="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*T;var ne=te.height+2*T,ae=$+ne>=E;return ne<=E&&($<=z?$=L._offset+2*T:ae&&($=E-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,P,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*T,A=L.height+2*T}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,O,D=y.node().getBoundingClientRect(),N=e.xa._offset+(e.x0+e.x1)/2,F=e.ya._offset+(e.y0+e.y1)/2,j=Math.abs(e.x1-e.x0),B=Math.abs(e.y1-e.y0),H=D.width+M+T+k;if(e.ty0=z-D.top,e.bx=D.width+2*T,e.by=Math.max(D.height+2*T,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=N,S=F+B/2+H<=E,O=F-B/2-H>=0,"top"!==e.idealAlign&&S||!O?S?(F+=B/2,e.anchor="start"):e.anchor="middle":(F-=B/2,e.anchor="end");else if(e.pos=F,S=N+j/2+H<=R,O=N-j/2-H>=0,"left"!==e.idealAlign&&S||!O)if(S)N+=j/2,e.anchor="start";else{e.anchor="middle";var q=H/2,U=N+q-R,G=N-q;U>0&&(N-=U),G<0&&(N+=-G)}else N-=j/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+N+","+F+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=R(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=R(r,e.nameLength),""}))),[s,l]}function P(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(M+T),f=c+l*(e.txwidth+T),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+T),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*M+d)+","+(M+p)+"v"+(e.by/2-M)+"h"+o*e.bx+"v-"+e.by+"H"+(o*M+d)+"V"+(p-M)+"Z");var h=c+d,g=p+e.ty0-e.by/2+T,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+T:-e.bx-T):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-T:e.bx+T)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*T+d,p+e.ty0-e.by/2+T),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function O(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,M=a.spikecolor||_,T=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=T,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:M,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?k:-k),cy:m,r:k,fill:M}).classed("spikeline",!0)}if(h){var S,C,P=t.vLinePoint;n=P&&P.xa,a=P&&P.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+P.x,C=a._offset+P.y);var O,D,z=i.readability(P.color,g)<1.5?f.contrast(g):P.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,N=p.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(O=N,D=C),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=s.t+(1-j)*s.h,D=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?E:-E),r:E,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function R(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":177,"../../lib/events":169,"../../lib/override_cursor":188,"../../lib/svg_text_utils":198,"../../plots/cartesian/axes":222,"../../registry":272,"../color":50,"../dragelement":69,"../drawing":72,"../legend/defaults":102,"../legend/draw":103,"./constants":84,"./helpers":86,d3:13,"fast-isnumeric":15,tinycolor2:32}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":177,"../color":50,"./helpers":86}],89:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",M,w,x,y),y:u("y",M,k,b,m,_)}}else delete t.grid}function M(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":177,"../../plot_api/plot_template":212,"../../plots/layout_attributes":261,"../../registry":272,"./attributes":100,"./helpers":106}],103:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(T,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(T,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):T(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function T(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),k=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,P.font).text(P.text),T(O,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var R=z.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,M=a.x>1||1===a.x&&"left"===w,T=y||m,S=i.width/2;a._maxWidth=Math.max(k?T&&"left"===w?o.l+o.w:S:M?T&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,P=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),P+=t})),x=null;var O=0;if(s){var D=0,z=0,R=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(O=Math.max(O,z),z=0,R+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,R),z+=r})),a._width=Math.max(O,z)+u,a._height=R+D+g}else{var E=r.size(),I=P+f+(E-1)*ha._maxWidth&&(O=Math.max(O,B),F=0,j+=N,a._height+=N,N=0),c.setTranslate(this,_[0]+u+F,_[1]+u+j+t/2+h),B=F+r+h,F+=n,N=Math.max(N,t)})),I?(a._width=F+f,a._height=N+g):(a._width=Math.max(O,B)+f,a._height+=N+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=e._context.edits,q=H.legendText||H.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=q?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,R,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,M=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var T=w,P=M;w=a.constrain(w,0,l.width-t._width),M=a.constrain(M,0,l.height-t._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),M!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,M),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;t._main||(O=t._height),S.attr({width:t._width-b,height:O-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:O-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,R,E,I=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),N=t._effHeight-I-2*p.scrollBarMargin,F=t._height-t._effHeight,j=N/F,B=Math.min(t._scrollY||0,F);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,I,j),g.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/N*F,0,F),I,j),0!==B&&B!==F&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,E=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/j+e;return a.constrain(n,0,F)}(E,z,R),I,j))}));D.call(H);var q=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,E=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/j+e;return a.constrain(n,0,F)}(E,z,R),I,j))}));C.call(q)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":152,"../../lib":177,"../../lib/events":169,"../../lib/svg_text_utils":198,"../../plots/plots":263,"../../registry":272,"../color":50,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:13}],104:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),k=f||m,M=p||v,T=w||!k?"M5,0":M?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",T+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":177,"../../registry":272,"../../traces/pie/helpers":291,"../../traces/pie/style_one":292,"../../traces/scatter/subtypes":318,"../color":50,"../colorscale/helpers":61,"../drawing":72,d3:13}],109:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=I[r+1];else if(e=n.pmax)t=I[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(M=f,S="y0",T=y,C="y1"):(M=y,S="y1",T=f,C="y0");Y(n),J(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?X:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),Q(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;Q(l)}};function Y(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=U(x+n)):(o=function(e){return U(H(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),E?F("yanchor",r.yanchor=G(k+a)):(s=function(e){return G(q(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),F("path",r.path=w(D,o,s))}else R?F("xanchor",r.xanchor=U(x+n)):(F("x0",r.x0=U(c+n)),F("x1",r.x1=U(v+n))),E?F("yanchor",r.yanchor=G(k+a)):(F("y0",r.y0=G(f+a)),F("y1",r.y1=G(y+a)));t.attr("d",_(e,r)),J(l,r)}function W(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=U(x+n)):(o=function(e){return U(H(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),E?F("yanchor",r.yanchor=G(k+a)):(s=function(e){return G(q(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),F("path",r.path=w(D,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=E?f-a:f+a;F("x0",r.x0=R?u:U(u)),F("y0",r.y0=E?d:G(d))}else if("resize-over-end-point"===z){var p=v+n,h=E?y-a:y+a;F("x1",r.x1=R?p:U(p)),F("y1",r.y1=E?h:G(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),V=m("s"),Z=m("w"),Y=m("e"),X=b?M+a:M,W=V?T+a:T,Q=Z?A+n:A,$=Y?L+n:L;E&&(b&&(X=M-a),V&&(W=T-a)),(!E&&W-X>10||E&&X-W>10)&&(F(S,r[S]=E?X:G(X)),F(C,r[C]=E?W:G(W))),$-Q>10&&(F(P,r[P]=R?Q:U(Q)),F(O,r[O]=R?$:U($)))}t.attr("d",_(e,r)),J(l,r)}function J(e,t){(R||E)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=H(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=q(E?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&E){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function Q(e){e.selectAll(".visual-cue").remove()}d.init(Z),V.node().onmousemove=Y}(e,R,s,t,r,z):!0===s.editable&&R.style("pointer-events",O||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,v(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),k=Math.abs(_-u),M="A"+w+","+k,T=b+w+","+_;return"M"+T+M+" 0 1,1 "+(b+","+(_-k))+M+" 0 0,1 "+T+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),T&&!d)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(M,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return R.call(E),D&&(L?R.on(".opacity",null):(M=0,T=!0,R.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(E)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),R.classed("js-placeholder",T),w}}},{"../../constants/alignment":152,"../../constants/interactions":154,"../../lib":177,"../../lib/svg_text_utils":198,"../../plots/plots":263,"../../registry":272,"../color":50,"../drawing":72,d3:13,"fast-isnumeric":15}],146:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":170,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":262,"../color/attributes":49}],147:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":177,"../../plots/array_container_defaults":218,"./attributes":146,"./constants":147}],149:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:T,height:A}),this._hbarXMin=L+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>k,O=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,R=v;z+O>s&&(z=s-O);var E=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=E.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:R,width:O,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,N=u-.5,F=P?f+O+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(M||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),M||P?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||P){var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(U),P&&this.vbar.on(".drag",null).call(U)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":177,"../color":50,"../drawing":72,d3:13}],152:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],153:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],154:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],155:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],156:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],157:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],160:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],161:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":184}],162:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var M=k[1],T=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===M.length)return u;var P;M=Number(M);try{var O=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),P=O.newDate(M,O.toMonthIndex(M,T,D),A)}else P=O.newDate(M,Number(T),A)}catch(e){return u}return P?(P.toJD()-g)*f+L*d+S*p+C*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),T-=1;var z=new Date(Date.UTC(2e3,T,A,L,S));return z.setUTCFullYear(M),z.getUTCMonth()!==T||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,M=3*d,T=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var P=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":184}],176:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],177:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function M(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var P={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(P,arguments)};var O={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(O,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;s.seedPseudoRandom=function(){R=2e9},s.pseudoRandom=function(){var e=R;return R=(69069*R+1)%4294967296,Math.abs(R-e)<429496729?s.pseudoRandom():R/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":155,"./anchor_utils":160,"./angles":161,"./array":162,"./clean_number":163,"./clear_responsive":165,"./coerce":166,"./dates":167,"./dom":168,"./extend":170,"./filter_unique":171,"./filter_visible":172,"./geometry2d":175,"./identity":176,"./is_plain_object":178,"./keyed_container":179,"./localize":180,"./loggers":181,"./make_trace_groups":182,"./matrix":183,"./mod":184,"./nested_property":185,"./noop":186,"./notifier":187,"./push_unique":190,"./regex":192,"./relative_attr":193,"./relink_private":194,"./search":195,"./stats":197,"./throttle":199,"./to_log_range":200,d3:13,"fast-isnumeric":15}],178:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],179:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":187}],182:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:13}],183:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],185:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":155,"./matrix":183}],190:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":162,"fast-isnumeric":15}],198:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,T){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var P=e.attr("class")?e.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void t();var s=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:P,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===P[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===P[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===P[0]&&0!==P.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),T&&T.call(e,s),t(s)}))}))):O(),e}function O(){C.empty()||(P=e.attr("class")+"-math",C.select("svg."+P).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),P=0;P|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var M=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):T[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],200:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":15}],201:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":252,"topojson-client":33}],202:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,M,T,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],P=u(m,f).get(),O=[],D=-1,z=C.length;for(x=0;xC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?O.push(_):T?("add"===M&&(M={}),C.splice(_,0,M),P&&P.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(O[x],1),P&&P.splice(O[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var R;if(-1===D)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x=D);x++)R.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function E(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function U(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(M.layoutReplot):Object.keys(n).length&&(G(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(M.doLegend),i.layoutstyle&&l.push(M.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(M.doTicksRelayout),i.modebar&&l.push(M.doModeBar),i.camera&&l.push(M.doCamera),i.colorbars&&l.push(M.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,U,[e,a.undoit],U,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function G(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,M.doAutoRangeAndConstraints,r,M.drawData,M.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=j(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(q(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],N=z.parts[E-1]+"."+I,B=z.parts.slice(0,E).join("."),H=l(e.layout,B).get(),U=l(s,B).get(),G=z.get();if(void 0!==R){M[D]=R,L[D]="reverse"===I?R:F(G);var V=f.getLayoutValObject(s,z.parts);if(V&&V.impliedEdits&&null!==R)for(var W in V.impliedEdits)S(o.relativeAttr(D,W),V.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(R){S("autosize",null);var Q="height"===D?"width":"height";S(Q,s[Q])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",R?null:s.width),S("height",R?null:s.height);else if(N.match(Z))O(N),l(s,B+"._inputRange").set(null);else if(N.match(Y)){O(N),l(s,B+"._inputRange").set(null);var $=l(s,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(X)&&l(s,B+"._inputDomain").set(null);if("type"===I){var K=H,ee="linear"===U.type&&"log"===R,te="log"===U.type&&"linear"===R;if(ee||te){if(K&&K.range)if(U.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(B+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(B+".range[0]",Math.log(re)/Math.LN10),S(B+".range[1]",Math.log(ne)/Math.LN10)):(S(B+".range[0]",Math.pow(10,re)),S(B+".range[1]",Math.pow(10,ne)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,U,R,S),u.getComponentMethod("images","convertCoords")(e,U,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(R||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=V||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(R)?L[D]=null:w.isRemoveVal(R)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=R,delete t[D]}else"reverse"===I?(H.range?H.range.reverse():(S(B+".autorange",!0),H.range=[1,0]),U.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?_.plot=!0:V?T.update(_,V):_.calc=!0,z.set(R))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in P)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&T.push(g);y=T}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":177,"../plots/attributes":219}],213:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?k(u,M,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,P=l.yaxis.domain,O=l.plotgroup;if(y(C,P,L)){var D=O.node(),z=l.bg=o.ensureSingle(O,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else O.select("rect.bg").remove(),L.push([C,P]),S||(T.push(a),A.push(a))}var R,E,I,N,F,j,B,H,q,U,G,V,Z,Y=v._bgLayer.selectAll(".bg").data(T);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":177,"../plots/attributes":219,"../plots/plots":263,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var T=o.extendFlat({},d);x?T.width=x:null===t.width&&n(h.width)&&(T.width=h.width),b?T.height=b:null===t.height&&n(h.height)&&(T.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(M,r,T,A).then(L).then(S).then(C).then((function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":177,"../plots/plots":263,"../snapshot/helpers":276,"../snapshot/svgtoimg":278,"../snapshot/tosvg":280,"../version":331,"./plot_api":209,"fast-isnumeric":15}],216:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var T,A,L,S,C,P=x.length,O=Array.isArray(M);if(O&&(P=Math.min(P,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(T=0;T<(O?Math.min(D,M[A].length):D);T++)L=O?M[A][T]:M,S=y[A][T],C=x[A][T],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,T),S,C)):a.push(h("value",i,m.concat(A,T),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=T-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/T>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/T));if(d===p){var C=d-1,P=d+1;if(k)if(0===d)i=[0,1];else{var O=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,O/T));i=d>0?[0,D]:[D,0]}else i=M?[Math.max(0,C),Math.max(1,P)]:[C,P]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):M&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(T-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,M=r.vpadLinearized||!1;function T(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=T((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":155,"../../lib":177,"../../registry":272,"fast-isnumeric":15}],222:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),M=k.MID_SHIFT,T=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),P=e("./axis_ids");S.id2name=P.id2name,S.name2id=P.name2id,S.cleanId=P.cleanId,S.list=P.list,S.listIds=P.listIds,S.getFromId=P.getFromId,S.getFromTrace=P.getFromTrace;var O=e("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),G(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Y(e.exponentformat)&&!X(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function V(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*U(t,r,I)):i>v?(t/=v,e.dtick="M"+U(t,1,N)):i>m?(e.dtick=U(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:j),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=U(t,y,N):i>x?e.dtick=U(t,x,F):i>b?e.dtick=U(t,b,F):(r=n(10),e.dtick=U(t,r,I))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+U(t,r,I)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=U(t,r,q)):(e.tick0=0,r=n(10),e.dtick=U(t,r,I));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?H:B,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Y(p)&&X(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function Y(e){return"SI"===e||"B"===e}function X(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};G(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":Y(s)&&(e+=Z[c/3+5]));return i?_+e:e}function J(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}X&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||X&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*M},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],Q);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||k)for(r=0;rz&&IO&&(O=I);p/=(O-P)/(2*D),P=c.l2r(P),O=c.l2r(O),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function F(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function j(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),B(e,t,a,i)}function B(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function H(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){P&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),P=!1)}function U(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(H(a),2!==e||he||He(),pe)i.indexOf("select")>-1&&T(r,a,W,J,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?B:O,c="s"===g||"w"===P?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===P&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){Me="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(Me="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",U(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){Me="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",U(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":177,"fast-isnumeric":15}],240:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":152}],241:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),T=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),P=C.p2r,O=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){N(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)Y._fullLayout._deactivateShape(Y);else if(!B){var r=X.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,Y,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&Y.emit("plotly_selected",void 0);l.click(Y,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),B&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:z}},{"../../components/color":50,"../../components/dragelement/helpers":68,"../../components/drawing":72,"../../components/fx":90,"../../components/fx/helpers":86,"../../components/shapes/draw_newshape/display_outlines":135,"../../components/shapes/draw_newshape/helpers":136,"../../components/shapes/draw_newshape/newshapes":137,"../../lib":177,"../../lib/clear_gl_canvases":164,"../../lib/polygon":189,"../../lib/throttle":199,"../../plot_api/subroutines":213,"../../registry":272,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:23}],242:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function M(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function T(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(M(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function O(e){var t=P(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var R=function(t){return a(t)?D(t,e._m,e._b):p},E=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;R=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},E=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?T:c,e.l2c="log"===e.type?k:c,e.l2p=R,e.p2l=E,e.c2p="log"===e.type?function(e,t){return R(T(e,t))}:R,e.p2c="log"===e.type?function(e){return k(E(e))}:E,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=E,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return T(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=T,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(E(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=E,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(E(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=c,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,M=f?p[0]:0,T=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,M,T).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":72,"../../lib":177,"../../registry":272,"./axes":222,d3:13}],247:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new _(e)},w.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var l in m.layerNameToAdjective)if("frame"!==l&&a["show"+l]){o=!0;break}for(var s=0;s0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),c.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this.render()}},w.updateProjection=function(e,t){var r=this.graphDiv,o=t[this.id],l=t._size,s=o.domain,c=o.projection,u=o.lonaxis,d=o.lataxis,p=u._ax,h=d._ax,g=this.projection=function(e){for(var t=e.projection.type,r=n.geo[m.projNames[t]](),a=e._isClipped?m.lonaxisSpan[t]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(e){return e?r:[]},l=0;la*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(e){return r.getPath().bounds(e)},r.fitExtent=function(e,t){var n=e[1][0]-e[0][0],a=e[1][1]-e[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(t),l=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),s=+e[0][0]+(n-l*(o[1][0]+o[0][0]))/2,c=+e[0][1]+(a-l*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*l).translate([s,c])},r.precision(m.precision),a&&r.clipAngle(a-m.clipPad);return r}(o),v=[[l.l+l.w*s.x[0],l.t+l.h*(1-s.y[1])],[l.l+l.w*s.x[1],l.t+l.h*(1-s.y[0])]],y=o.center||{},x=c.rotation||{},b=u.range||[],_=d.range||[];if(o.fitbounds){p._length=v[1][0]-v[0][0],h._length=v[1][1]-v[0][1],p.range=f(r,p),h.range=f(r,h);var w=(p.range[0]+p.range[1])/2,M=(h.range[0]+h.range[1])/2;if(o._isScoped)y={lon:w,lat:M};else if(o._isClipped){y={lon:w,lat:M},x={lon:w,lat:M,roll:x.roll};var T=c.type,A=m.lonaxisSpan[T]/2||180,L=m.lataxisSpan[T]/2||180;b=[w-A,w+A],_=[M-L,M+L]}else y={lon:w,lat:M},x={lon:w,lat:x.lat,roll:x.roll}}g.center([y.lon-x.lon,y.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(c.parallels);var S=k(b,_);g.fitExtent(v,S);var C=this.bounds=g.getBounds(S),P=this.fitScale=g.scale(),O=g.translate();if(!isFinite(C[0][0])||!isFinite(C[0][1])||!isFinite(C[1][0])||!isFinite(C[1][1])||isNaN(O[0])||isNaN(O[0])){for(var D=["fitbounds","projection.rotation","center","lonaxis.range","lataxis.range"],z="Invalid geo settings, relayout'ing to default view.",R={},E=0;E-1&&g(n.event,i,[r.xaxis],[r.yaxis],r.id,f),c.indexOf("event")>-1&&s.click(i,n.event))}))}function m(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},w.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(l.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(e.mockAxis,r)},w.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},i.extendFlat(this.viewInitial,t)},w.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":50,"../../components/dragelement":69,"../../components/drawing":72,"../../components/fx":90,"../../lib":177,"../../lib/geo_location_utils":173,"../../lib/topojson_utils":201,"../../registry":272,"../cartesian/autorange":221,"../cartesian/axes":222,"../cartesian/select":241,"../plots":263,"./constants":252,"./projections":257,"./zoom":258,d3:13,"topojson-client":33}],254:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&P<0&&(P+=360);var O,D,z,R=(C+P)/2;if(!p){var E=h?f.projRotate:[R,0,0];O=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!h&&y)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!y&&void 0)&&r("oceancolor")}(p?(D=-96.6,z=38.7):(D=h?R:O,z=(S[0]+S[1])/2),r("center.lon",D),r("center.lat",z),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!y&&void 0)&&r("landcolor"),r("showlakes",!!y&&void 0)&&r("lakecolor"),r("showrivers",!!y&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&y)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",y),r("subunitcolor"),r("subunitwidth")),h||r("showframe",y)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):v?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":177,"../get_data":259,"../subplot_defaults":270,"./constants":252,"./layout_attributes":255}],257:[function(e,t,r){"use strict";t.exports=function(e){function t(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:r(e.geometry,t)}}function r(t,n){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map((function(e){return r(e,n)}))};if(!c.hasOwnProperty(t.type))return null;var a=c[t.type];return e.geo.stream(t,n(a)),a.result()}e.geo.project=function(e,t){var a=t.stream;if(!a)throw new Error("not yet supported");return(e&&n.hasOwnProperty(e.type)?n[e.type]:r)(e,a)};var n={Feature:t,FeatureCollection:function(e,r){return{type:"FeatureCollection",features:e.features.map((function(e){return t(e,r)}))}}},a=[],i=[],o={point:function(e,t){a.push([e,t])},result:function(){var e=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],e}},l={lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var e=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],e}},s={polygonStart:u,lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){var e=a.length;if(e){do{a.push(a[0].slice())}while(++e<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var e=[],t=[];return i.forEach((function(r){!function(e){if((t=e.length)<4)return!1;var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];for(;++rn^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0}))||e.push([t])})),i=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}},c={Point:o,MultiPoint:o,LineString:l,MultiLineString:l,Polygon:s,MultiPolygon:s,Sphere:s};function u(){}var f=1e-6,d=Math.PI,p=d/2,h=(Math.sqrt(d),d/180),g=180/d;function v(e){return e>1?p:e<-1?-p:Math.asin(e)}function m(e){return e>1?0:e<-1?d:Math.acos(e)}var y=e.geo.projection,x=e.geo.projectionMutator;function b(e,t){var r=(2+p)*Math.sin(t);t/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>f;n++){var i=Math.cos(t);t-=a=(t+Math.sin(t)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(d*(4+d))*e*(1+Math.cos(t)),2*Math.sqrt(d/(4+d))*Math.sin(t)]}e.geo.interrupt=function(t){var r,n=[[[[-d,0],[0,p],[d,0]]],[[[-d,0],[0,-p],[d,0]]]];function a(e,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,l=i.length-1;oi[o][2][0];++o);var s=t(e-i[o][1][0],r);return s[0]+=t(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],s}function i(){r=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],a=t(e[2][0],e[2][1])[0],i=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))}))}t.invert&&(a.invert=function(e,i){for(var o=r[+(i<0)],l=n[+(i<0)],s=0,u=o.length;s=0;--a){var p;o=180*(p=n[1][a])[0][0]/d,l=180*p[0][1]/d,c=180*p[1][1]/d,u=180*p[2][0]/d,f=180*p[2][1]/d;r.push(s([[u-t,f-t],[u-t,c+t],[o+t,c+t],[o+t,l-t]],30))}return{type:"Polygon",coordinates:[e.merge(r)]}}(),i)},a},o.lobes=function(e){return arguments.length?(n=e.map((function(e){return e.map((function(e){return[[e[0][0]*d/180,e[0][1]*d/180],[e[1][0]*d/180,e[1][1]*d/180],[e[2][0]*d/180,e[2][1]*d/180]]}))})),i(),o):n.map((function(e){return e.map((function(e){return[[180*e[0][0]/d,180*e[0][1]/d],[180*e[1][0]/d,180*e[1][1]/d],[180*e[2][0]/d,180*e[2][1]/d]]}))}))},o},b.invert=function(e,t){var r=.5*t*Math.sqrt((4+d)/d),n=v(r),a=Math.cos(n);return[e/(2/Math.sqrt(d*(4+d))*(1+a)),v((n+r*(a+2))/(2+p))]},(e.geo.eckert4=function(){return y(b)}).raw=b;var _=e.geo.azimuthalEqualArea.raw;function w(e,t){if(arguments.length<2&&(t=e),1===t)return _;if(t===1/0)return k;function r(r,n){var a=_(r/t,n);return a[0]*=e,a}return r.invert=function(r,n){var a=_.invert(r/e,n);return a[0]*=t,a},r}function k(e,t){return[e*Math.cos(t)/Math.cos(t/=2),2*Math.sin(t)]}function M(e,t){return[3*e/(2*d)*Math.sqrt(d*d/3-t*t),t]}function T(e,t){return[e,1.25*Math.log(Math.tan(d/4+.4*t))]}function A(e){return function(t){var r,n=e*Math.sin(t),a=30;do{t-=r=(t+Math.sin(t)-n)/(1+Math.cos(t))}while(Math.abs(r)>f&&--a>0);return t/2}}k.invert=function(e,t){var r=2*v(t/2);return[e*Math.cos(r/2)/Math.cos(r),r]},(e.geo.hammer=function(){var e=2,t=x(w),r=t(e);return r.coefficient=function(r){return arguments.length?t(e=+r):e},r}).raw=w,M.invert=function(e,t){return[2/3*d*e/Math.sqrt(d*d/3-t*t),t]},(e.geo.kavrayskiy7=function(){return y(M)}).raw=M,T.invert=function(e,t){return[e,2.5*Math.atan(Math.exp(.8*t))-.625*d]},(e.geo.miller=function(){return y(T)}).raw=T,A(d);var L=function(e,t,r){var n=A(r);function a(r,a){return[e*r*Math.cos(a=n(a)),t*Math.sin(a)]}return a.invert=function(n,a){var i=v(a/t);return[n/(e*Math.cos(i)),v((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/p,Math.SQRT2,d);function S(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(e.geo.mollweide=function(){return y(L)}).raw=L,S.invert=function(e,t){var r,n=t,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-t)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(e.geo.naturalEarth=function(){return y(S)}).raw=S;var C=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function P(e,t){var r,n=Math.min(18,36*Math.abs(t)/d),a=Math.floor(n),i=n-a,o=(r=C[a])[0],l=r[1],s=(r=C[++a])[0],c=r[1],u=(r=C[Math.min(19,++a)])[0],f=r[1];return[e*(s+i*(u-o)/2+i*i*(u-2*s+o)/2),(t>0?p:-p)*(c+i*(f-l)/2+i*i*(f-2*c+l)/2)]}function O(e,t){return[e*Math.cos(t),t]}function D(e,t){var r,n=Math.cos(t),a=(r=m(n*Math.cos(e/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(e)*a,Math.sin(t)*a]}function z(e,t){var r=D(e,t);return[(r[0]+e/p)/2,(r[1]+t)/2]}C.forEach((function(e){e[1]*=1.0144})),P.invert=function(e,t){var r=t/p,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=C[i][1],l=C[i+1][1],s=C[Math.min(19,i+2)][1],c=s-o,u=s-2*l+o,f=2*(Math.abs(r)-l)/c,d=u/c,v=f*(1-d*f*(1-2*d*f));if(v>=0||1===i){n=(t>=0?5:-5)*(v+a);var m,y=50;do{v=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=C[i][1],l=C[i+1][1],s=C[Math.min(19,i+2)][1],n-=(m=(t>=0?p:-p)*(l+v*(s-o)/2+v*v*(s-2*l+o)/2)-t)*g}while(Math.abs(m)>1e-12&&--y>0);break}}while(--i>=0);var x=C[i][0],b=C[i+1][0],_=C[Math.min(19,i+2)][0];return[e/(b+v*(_-x)/2+v*v*(_-2*b+x)/2),n*h]},(e.geo.robinson=function(){return y(P)}).raw=P,O.invert=function(e,t){return[e/Math.cos(t),t]},(e.geo.sinusoidal=function(){return y(O)}).raw=O,D.invert=function(e,t){if(!(e*e+4*t*t>d*d+f)){var r=e,n=t,a=25;do{var i,o=Math.sin(r),l=Math.sin(r/2),s=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),p=Math.sin(2*n),h=c*c,g=u*u,v=l*l,y=1-g*s*s,x=y?m(u*s)*Math.sqrt(i=1/y):i=0,b=2*x*u*l-e,_=x*c-t,w=i*(g*v+x*u*s*h),k=i*(.5*o*p-2*x*c*l),M=.25*i*(p*l-x*c*g*o),T=i*(h*s+x*v*u),A=k*M-T*w;if(!A)break;var L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]}},(e.geo.aitoff=function(){return y(D)}).raw=D,z.invert=function(e,t){var r=e,n=t,a=25;do{var i,o=Math.cos(n),l=Math.sin(n),s=Math.sin(2*n),c=l*l,u=o*o,d=Math.sin(r),h=Math.cos(r/2),g=Math.sin(r/2),v=g*g,y=1-u*h*h,x=y?m(o*h)*Math.sqrt(i=1/y):i=0,b=.5*(2*x*o*g+r/p)-e,_=.5*(x*l+n)-t,w=.5*i*(u*v+x*o*h*c)+.5/p,k=i*(d*s/4-x*l*g),M=.125*i*(s*g-x*l*u*d),T=.5*i*(c*h+x*v*o)+.5,A=k*M-T*w,L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]},(e.geo.winkel3=function(){return y(z)}).raw=z}},{}],258:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render();var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return b(r[0],r[1],i,v)<=b(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function b(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function k(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function M(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var F=!(!a._has||!a._has("gl2d")),j=!(!l._has||!l._has("gl2d")),B=!(!a._has||!a._has("cartesian"))||F,H=!(!l._has||!l._has("cartesian"))||j;B&&!H?a._bgLayer.remove():H&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),L(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,k=b.val,M=b.size;for(var T in h){if(a(w)&&h[T].r){var A=h[T].r.val,S=h[T].r.size;if(A>_){var C=(w*A+(S-d)*_)/(A-_),P=(S*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&P>=0&&d-(C+P)>0&&C+P>l+c&&(l=C,c=P)}}if(a(M)&&h[T].t){var O=h[T].t.val,D=h[T].t.size;if(O>k){var z=(M*O+(D-p)*k)/(O-k),R=(D*(1-k)+(M-p)*(1-O))/(O-k);z>=0&&R>=0&&p-(R+z)>0&&z+R>f+u&&(f=z,u=R)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var E=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(O(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);T&&!M&&(S=0);var C=L.slice();A&&M&&(C[1]+=S);var P=d.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),d.angularAxis.ticksStep&&(P=(C[1]-C[0])/P);var O=d.angularAxis.ticksStep||(C[1]-C[0])/(P*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.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 E,I=e.select(".chart-group"),N={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){E=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:E,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=E.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),E.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else E=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),d.title&&d.title.text){var q=e.select("g.title-group text").style(F).text(d.title.text),U=q.node().getBBox();q.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var G=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var V=G.selectAll("circle.grid-circle").data(r.ticks(5));V.enter().append("circle").attr({class:"grid-circle"}).style(N),V.attr("r",r),V.exit().remove()}G.select("circle.outside-circle").attr({r:x}).style(N);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),G.selectAll(".domain").style(N),G.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(N),J.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(F);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(F);d.angularAxis.rewriteTicks&&Q.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));E.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!M){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":152,"../../../lib":177,d3:13}],268:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":50,"../../../lib":177,"./micropolar":267,"./undo_manager":269,d3:13}],269:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":50,"../components/drawing":72,"../constants/xmlns_namespaces":156,"../lib":177,d3:13}],281:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":49,"../../components/colorscale/attributes":57,"../../lib/extend":170,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattergeo/attributes":321}],282:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o,d.mockAxis),[e]}},{"../../lib":177,"../../plots/cartesian/axes":222,"./attributes":281}],286:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":254,"../heatmap/colorbar":290,"./attributes":281,"./calc":282,"./defaults":283,"./event_data":284,"./hover":285,"./plot":287,"./select":288,"./style":289}],287:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;pl&&T[v].gap;)v--;for(y=T[v].s,h=T.length-1;h>v;h--)T[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],301:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mV!=(N=D[P][1])>=V&&(R=D[P-1][0],E=D[P][0],N-I&&(z=R+(E-R)*(V-I)/(N-I),H=Math.min(H,z),q=Math.max(q,z)));H=Math.max(H,0),q=Math.min(q,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:H,x1:q,y0:V,y1:V,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":50,"../../components/fx":90,"../../lib":177,"../../registry":272,"./get_trace_color":304}],306:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":293,"./attributes":294,"./calc":295,"./cross_trace_calc":299,"./cross_trace_defaults":300,"./defaults":301,"./format_labels":303,"./hover":305,"./marker_colorbar":312,"./plot":314,"./select":315,"./style":317,"./subtypes":318}],307:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"../../lib":177}],308:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,M,T,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,P="log"===S.type,O=L._length,D=S._length,z=t.connectGaps,R=t.baseTolerance,E=t.shape,I="linear"===E,N=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),q=0;function U(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;P&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*O*(S._m>0?o:l)))),i*=1e3}if(s===a){if(P&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function G(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[q-1][0],a=r===H[q-1][1];if(!n||!a)if(q>1){var i=t===H[q-2][0],o=r===H[q-2][1];n&&(t===te||t===re)&&i?o?q--:H[q-1]=e:a&&(r===ne||r===ae)&&o?i?q--:H[q-1]=e:H[q++]=e}else H[q++]=e}function ue(e){H[q-1][0]!==e[0]&&H[q-1][1]!==e[1]&&ce([W,J]),ce(e),Q=null,W=J=0}function fe(e){if(T=e[0]/O,A=e[1]/D,Y=e[0]re?re:0,X=e[1]ae?ae:0,Y||X){if(q)if(Q){var t=K(Q,e);t.length>1&&(ue(t[0]),H[q++]=t[1])}else $=K(H[q-1],e)[0],H[q++]=$;else H[q++]=[Y||e[0],X||e[1]];var r=H[q-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(Q&&(W!==Y&&J!==X?ce(W&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,J||X]):W&&J&&ce([W,J])),ce([Y,X])):W-Y&&J-X&&ce([Y||W,X||J]),Q=e,W=Y,J=X}else Q&&ue(K(Q,e)[0]),H[q++]=e;var n,a,i,o}for("linear"===E||"spline"===E?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)V(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}Q&&ce([W||Q[0],J||Q[1]]),F.push(H.slice(0,q))}return F}},{"../../constants/numerical":155,"../../lib":177,"./constants":298}],309:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],310:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":15}],312:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],313:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"./subtypes":318}],314:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),M=o(k,"g","errorbars"),T=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var P=_.fill.charAt(_.fill.length-1);"x"!==P&&"y"!==P&&(P=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var O,D,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,N,F,j,B,H,q,U="",G="",V=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):I=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),q=_._polygons=new Array(V.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),s.singleLineStyle(f,a)}}}}}var Y=T.selectAll(".js-line").data(V);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(P?("y"===P?j[1]=H[1]=b.c2p(0,!0):"x"===P&&(j[0]=H[0]=x.c2p(0,!0)),y(S).attr("d","M"+H+"L"+j+"L"+U.substr(1)).call(s.singleFillStyle)):y(S).attr("d",U+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&U&&z?("tonext"===_.fill?y(C).attr("d",U+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",U+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=q):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var k,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":72,"../../lib":177,"../../lib/polygon":189,"../../registry":272,"./line_points":308,"./link_traces":310,"./subtypes":318,d3:13}],315:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":90,"../../constants/numerical":155,"../../lib":177,"../scatter/get_trace_color":304,"./attributes":321}],327:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":254,"../scatter/marker_colorbar":312,"../scatter/style":317,"./attributes":321,"./calc":322,"./defaults":323,"./event_data":324,"./format_labels":325,"./hover":326,"./plot":328,"./select":329,"./style":330}],328:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;r=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],26:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(E(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function O(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function E(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],33:[function(e,t,r){!function(e,n){"object"==typeof r&&"undefined"!=typeof t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,V=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(G=!0):G=!0),Y=te._offset+te.r2p(t[$]),J=.5}else"x"===$?(W=t[$],Y=b.l+b.w*W):(W=1-t[$],Y=b.t+b.h*W),J=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+$];Q=ne*H(.5,t.xanchor)-ae*H(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=Q):(se.tail=Y+ue,X=Q+ue),se.text=se.tail+Q;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=Q=ie*H(J,oe),se.text=Y+Q;se.text+=le,Q+=le,X+=le,t["_"+$+"padplus"]=ie/2+X,t["_"+$+"padminus"]=ie/2-X,t["_"+$+"size"]=ie,t["_"+$+"shift"]=Q}if(G)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,F?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;q.call(f.positionText,me,ve).call(c.setClipUrl,F?A:null,e)}j.select("rect").call(c.setRect,I,I,w,D),N.call(c.setRect,R/2,R/2,E-R,B-R),z.call(c.setTranslate,Math.round(L.x.text-E/2),Math.round(L.y.text-B/2)),P.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),O=+N.attr("width"),D=+N.attr("height"),R=m-.5*O,E=R+O,I=y-.5*D,F=I+D,j=[[R,I,R,F],[R,F,E,F],[E,F,E,I],[E,I,R,I]].map(A);if(!j.reduce((function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){j.forEach((function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)}));var B=t.arrowwidth,H=t.arrowcolor,q=t.arrowside,U=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),G=U.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",B+"px").call(s.stroke,s.rgb(H));if(g(G,q,t),_.annotationPosition&&G.node().parentNode&&!i){var V=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));V+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,J=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(h-Z),transform:"translate("+V+","+Z+")"}).style("stroke-width",B+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),M("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),M("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&M("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&M("ay",v.p2r(v.r2p(t.ay)+r)),U.attr("transform","translate("+e+","+r+")"),P.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),O)p.init({element:z.node(),gd:e,prepFn:function(){ye=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?M("ax",l.p2r(l.r2p(t.ax)+e)):M("ax",t.ax+e),t.ayref===t.yref?M("ay",v.p2r(v.r2p(t.ay)+r)):M("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}M("x",a),M("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}P.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",U(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void O();if(m){if(m*m>x*x+b*b)return void O();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void O();var k=y*Math.cos(s),M=y*Math.sin(s);o.x-=k,o.y-=M,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var T=u.getTotalLength(),A="";if(T1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":260,"../annotations/draw":41}],48:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(V.tick0=0)}V.dtick=Z}V.domain=[q+j,q+I-j],V.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var J,Q=e.select("."+M.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+M.cbaxis),K=0;function ee(n,a){var i={propContainer:V,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var e,r=s.l+(t.x+N)*s.w,n=V.title.font.size;e="top"===T?(1-(q+I-j))*s.h+s.t+3+.75*n:(1-(q+j))*s.h+s.t-3-.25*n,ee(V._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=e.select("."+M.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+V._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===T)V.domain[1]-=K/s.h,u[1]*=-1;else{V.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),V.setScale()}}e.selectAll("."+M.cbfills+",."+M.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-V.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+M.cbfills).selectAll("rect."+M.cbfill).data(O);m.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(V.c2p).map(Math.round).sort((function(e,t){return e-t}));m.each((function(e,i){var o=[0===i?A[0]:(O[i]+O[i-1])/2,i===O.length-1?A[1]:(O[i]+O[i+1])/2].map(V.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:B,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+M.cblines).selectAll("path."+M.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(V.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)})),$.selectAll("g."+V._id+"tick,path").remove();var b=B+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(V),k=l.makeTransFn(V),C=l.getTickSigns(V)[2];return l.drawTicks(r,V,{vals:"inside"===V.ticks?l.clipEnds(V,w):w,layer:$,path:l.makeTickPath(V,b,C),transFn:k}),l.drawLabels(r,V,{vals:w,layer:$,transFn:k,labelFns:l.makeLabelFns(V,b)})},function(){if(-1===["top","bottom"].indexOf(T)){var e=V.title.font.size,t=V._offset+V._length/2,a=s.l+(V.position||0)*s.w+("right"===V.side?10+e*(V.showticklabels?1:.5):-10-e*(V.showticklabels?.5:0));ee("h"+V._id+"title",{avoid:{selection:n.select(r).selectAll("g."+V._id+"tick"),side:T,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((J=Q.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=Q.select(".h"+V._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?d.bBox(o).width:d.bBox(Q.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-G;e.select("."+M.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:G-F,width:Math.max(l,2),height:Math.max(c+2*F,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+M.cboutline).attr({x:B,y:G+t.ypad+("top"===T?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":152,"../../lib":177,"../../lib/extend":170,"../../lib/setcursor":196,"../../lib/svg_text_utils":198,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":263,"../../registry":272,"../color":50,"../colorscale/helpers":61,"../dragelement":69,"../drawing":72,"../titles":145,"./constants":52,d3:13,tinycolor2:32}],55:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":177}],56:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":51,"./defaults":53,"./draw":54,"./has_colorbar":55}],57:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":192,"../colorbar/attributes":51,"./scales.js":65}],58:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":177,"./helpers":61,"fast-isnumeric":15}],59:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],67:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":177}],68:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],69:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":177,"../../plots/cartesian/constants":228,"./align":66,"./cursor":67,"./unhover":70,"has-hover":17,"has-passive-events":18,"mouse-event-offset":21}],70:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":168,"../../lib/events":169,"../../lib/throttle":199,"../fx/constants":84}],71:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],72:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);m.translatePoint(e,a,t,r)}))},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)}))},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)}))};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)}));var x=m.symbolNames.length;function b(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each((function(e){m.singlePointStyle(e,n.select(this),t,a,r)}))}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",b(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],M[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var _=r.uid;h&&(_+="-"+e.i),m.gradient(t,a,_,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){l.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",b(m.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each((function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=L(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(A,h,g,e.mrc)}else i.remove()}))}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=L(e,t);l.fill(a,i),A(a,o,s,e.mrc2||e.mrc)}))}};function S(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var R=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(R,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var E=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(E);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}}))}},{"../../components/fx/helpers":86,"../../constants/alignment":152,"../../constants/interactions":154,"../../constants/xmlns_namespaces":156,"../../lib":177,"../../lib/svg_text_utils":198,"../../registry":272,"../../traces/scatter/make_bubble_size_func":311,"../../traces/scatter/subtypes":318,"../color":50,"../colorscale":62,"./symbol_defs":73,d3:13,"fast-isnumeric":15,tinycolor2:32}],73:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:13}],74:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],75:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":318,"../drawing":72,d3:13,"fast-isnumeric":15}],80:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":50,d3:13}],81:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":170,"../../plots/font_attributes":250,"./layout_attributes":91}],82:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,R="xval"in t?g.flat(s,t.xval):g.p2c(b,K),E="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(R[0])||!a(E[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;function ne(e,r){for(N=0;NZ&&(W.splice(0,Z),re=W[0].distance),m&&0!==X&&0===W.length){V.distance=X,V.index=!1;var d=j._module.hoverPoints(V,U,G,"closest",u._hoverlayer);if(d&&(d=d.filter((function(e){return e.spikeDistance<=X}))),d&&d.length){var p,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=ie(v),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>p.spikeDistance)&&(Q.vLinePoint=p))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=ie(x),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>p.spikeDistance)&&(Q.hLinePoint=p))}}}}}function ae(e,t){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===C&&$&&W.length>1,Te=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ae={hovermode:C,rotateLabels:Me,bgColor:Te,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Le=S(W,Ae,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Le,Me?"xa":"ya",u),P(Le,Me));if(t.target&&t.target.tagName){var Se=h.getComponentMethod("annotations","hasClickToShow")(e,be);c(n.select(t.target),Se?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,xe))return;xe&&e.emit("plotly_unhover",{event:t,points:xe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:R,yvals:E})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map((function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}})),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",P=w[S],O=(String(P)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,R=D.width,E=D.height,I=void 0!==P&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var N,F,j=!0;for(N=0;Na.width-S?(m=a.width-S,l.attr("d","M"+(S-M)+",0L"+S+","+A+M+"v"+A+(2*T+x.height)+"H-"+S+"V"+A+M+"H"+(S-2*M)+"Z")):l.attr("d","M0,0L"+M+","+A+M+"H"+(T+x.width/2)+"v"+A+(2*T+x.height)+"H-"+(T+x.width/2)+"V"+A+M+"H-"+M+"Z")}else{var C,O,D;"right"===L.side?(C="start",O=1,D="",m=k._offset+k._length):(C="end",O=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+M+","+M+"V"+(T+x.height/2)+"h"+D+(2*T+x.width)+"V-"+(T+x.height/2)+"H"+D+M+"V-"+M+"Z");var R,E=x.height/2,I=z-x.top-E,N="clip"+a._uid+"commonlabel"+L._id;if(m=0?K-=re:K+=2*T;var ne=te.height+2*T,ae=$+ne>=E;return ne<=E&&($<=z?$=L._offset+2*T:ae&&($=E-ne)),ee.attr("transform","translate("+K+","+$+")"),ee}var ie=d.selectAll("g.hovertext").data(e,(function(e){return A(e)}));return ie.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)})),ie.exit().remove(),ie.each((function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,P,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*T,A=L.height+2*T}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,O,D=y.node().getBoundingClientRect(),N=e.xa._offset+(e.x0+e.x1)/2,F=e.ya._offset+(e.y0+e.y1)/2,j=Math.abs(e.x1-e.x0),B=Math.abs(e.y1-e.y0),H=D.width+M+T+k;if(e.ty0=z-D.top,e.bx=D.width+2*T,e.by=Math.max(D.height+2*T,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=N,S=F+B/2+H<=E,O=F-B/2-H>=0,"top"!==e.idealAlign&&S||!O?S?(F+=B/2,e.anchor="start"):e.anchor="middle":(F-=B/2,e.anchor="end");else if(e.pos=F,S=N+j/2+H<=R,O=N-j/2-H>=0,"left"!==e.idealAlign&&S||!O)if(S)N+=j/2,e.anchor="start";else{e.anchor="middle";var q=H/2,U=N+q-R,G=N-q;U>0&&(N-=U),G<0&&(N+=-G)}else N-=j/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+N+","+F+")"+(l?"rotate("+x+")":""))})),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=R(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,(function(t,r){return l=R(r,e.nameLength),""}))),[s,l]}function P(e,t){e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(M+T),f=c+l*(e.txwidth+T),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+T),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*M+d)+","+(M+p)+"v"+(e.by/2-M)+"h"+o*e.bx+"v-"+e.by+"H"+(o*M+d)+"V"+(p-M)+"Z");var h=c+d,g=p+e.ty0-e.by/2+T,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+T:-e.bx-T):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-T:e.bx+T)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*T+d,p+e.ty0-e.by/2+T),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))}))}function O(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,M=a.spikecolor||_,T=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=T,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:M,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?k:-k),cy:m,r:k,fill:M}).classed("spikeline",!0)}if(h){var S,C,P=t.vLinePoint;n=P&&P.xa,a=P&&P.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+P.x,C=a._offset+P.y);var O,D,z=i.readability(P.color,g)<1.5?f.contrast(g):P.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,N=p.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(O=N,D=C),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=s.t+(1-j)*s.h,D=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?E:-E),r:E,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function R(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":177,"../../lib/events":169,"../../lib/override_cursor":188,"../../lib/svg_text_utils":198,"../../plots/cartesian/axes":222,"../../registry":272,"../color":50,"../dragelement":69,"../drawing":72,"../legend/defaults":102,"../legend/draw":103,"./constants":84,"./helpers":86,d3:13,"fast-isnumeric":15,tinycolor2:32}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":177,"../color":50,"./helpers":86}],89:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",M,w,x,y),y:u("y",M,k,b,m,_)}}else delete t.grid}function M(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":177,"../../plot_api/plot_template":212,"../../plots/layout_attributes":261,"../../registry":272,"./attributes":100,"./helpers":106}],103:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(T,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(T,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)})):T(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}}))}function T(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",(function(e){t._main&&e.attr("pointer-events","all")})),k=a.ensureSingleById(l._topdefs,"clipPath",f,(function(e){e.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,P.font).text(P.text),T(O,C,e,t)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var R=z.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){t._main&&n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,M=a.x>1||1===a.x&&"left"===w,T=y||m,S=i.width/2;a._maxWidth=Math.max(k?T&&"left"===w?o.l+o.w:S:M?T&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,P=0;r.each((function(e){var t=e[0].width+d;C=Math.max(C,t),P+=t})),x=null;var O=0;if(s){var D=0,z=0,R=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)})),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(O=Math.max(O,z),z=0,R+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,R),z+=r})),a._width=Math.max(O,z)+u,a._height=R+D+g}else{var E=r.size(),I=P+f+(E-1)*ha._maxWidth&&(O=Math.max(O,B),F=0,j+=N,a._height+=N,N=0),c.setTranslate(this,_[0]+u+F,_[1]+u+j+t/2+h),B=F+r+h,F+=n,N=Math.max(N,t)})),I?(a._width=F+f,a._height=N+g):(a._width=Math.max(O,B)+f,a._height+=N+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=e._context.edits,q=H.legendText||H.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=q?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)}))}(e,z,R,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,M=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var T=w,P=M;w=a.constrain(w,0,l.width-t._width),M=a.constrain(M,0,l.height-t._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),M!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,M),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;t._main||(O=t._height),S.attr({width:t._width-b,height:O-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:O-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,R,E,I=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),N=t._effHeight-I-2*p.scrollBarMargin,F=t._height-t._effHeight,j=N/F,B=Math.min(t._scrollY||0,F);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,I,j),g.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/N*F,0,F),I,j),0!==B&&B!==F&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,E=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/j+e;return a.constrain(n,0,F)}(E,z,R),I,j))}));D.call(H);var q=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,E=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/j+e;return a.constrain(n,0,F)}(E,z,R),I,j))}));C.call(q)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,g,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":152,"../../lib":177,"../../lib/events":169,"../../lib/svg_text_utils":198,"../../plots/plots":263,"../../registry":272,"../color":50,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:13}],104:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return h?n:Math.min(a,r)};function v(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=g(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)}))}function m(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=g(f(d.width,o.pts),d,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=d.color;var v=i.minExtend(o,{trace:h});u(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,f=n.select(this),p=s(a),h=p.colorscale,g=p.reversescale;if(h){if(!r){var v=h.length;u=0===c?h[g?v-1:0][1]:1===c?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[c]||m[0]:m}f.attr("d",e[0]),u?f.call(l.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,d(g,"radial"===r),h,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,v(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(e){v(e,this,"funnel")})).each((function(e){v(e,this)})).each((function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:h?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}}))})).each((function(e){m(e,this,"funnelarea")})).each((function(e){m(e,this,"pie")})).each((function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),h=u.contours,v=!1,m=!1,y=s(u),x=y.colorscale,b=y.reversescale;if(h){var _=h.coloring;"lines"===_?v=!0:p="none"===_||"heatmap"===_||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=c.hasMarkers(u)||c.hasText(u),k=f||m,M=p||v,T=w||!k?"M5,0":M?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(f||m?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,d(b),x,"fill")}}),p||v){var S=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:S}}),r=[i.minExtend(l,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(p||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",T+(v?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(b),x,"stroke")}})})).each((function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),d=c.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(h&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||d){var v={},m={};if(u){v.mc=p("marker.color",g),v.mx=p("marker.symbol",g),v.mo=p("marker.opacity",i.mean,[.2,1]),v.mlc=p("marker.line.color",g),v.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=p("textposition",g),v.ts=10,v.tc=p("textfont.color",g),v.tf=p("textfont.family",g)),r=[i.minExtend(l,v)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)}))}))}},{"../../lib":177,"../../registry":272,"../../traces/pie/helpers":291,"../../traces/pie/style_one":292,"../../traces/scatter/subtypes":318,"../color":50,"../colorscale/helpers":61,"../drawing":72,d3:13}],109:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=I[r+1];else if(e=n.pmax)t=I[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(M=f,S="y0",T=y,C="y1"):(M=y,S="y1",T=f,C="y0");Y(n),J(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),Z.moveFn="move"===z?X:W,Z.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),Q(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;Q(l)}};function Y(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=U(x+n)):(o=function(e){return U(H(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),E?F("yanchor",r.yanchor=G(k+a)):(s=function(e){return G(q(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),F("path",r.path=w(D,o,s))}else R?F("xanchor",r.xanchor=U(x+n)):(F("x0",r.x0=U(c+n)),F("x1",r.x1=U(v+n))),E?F("yanchor",r.yanchor=G(k+a)):(F("y0",r.y0=G(f+a)),F("y1",r.y1=G(y+a)));t.attr("d",_(e,r)),J(l,r)}function W(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=U(x+n)):(o=function(e){return U(H(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),E?F("yanchor",r.yanchor=G(k+a)):(s=function(e){return G(q(e)+a)},B&&"date"===B.type&&(s=g.encodeDate(s))),F("path",r.path=w(D,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=E?f-a:f+a;F("x0",r.x0=R?u:U(u)),F("y0",r.y0=E?d:G(d))}else if("resize-over-end-point"===z){var p=v+n,h=E?y-a:y+a;F("x1",r.x1=R?p:U(p)),F("y1",r.y1=E?h:G(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),V=m("s"),Z=m("w"),Y=m("e"),X=b?M+a:M,W=V?T+a:T,Q=Z?A+n:A,$=Y?L+n:L;E&&(b&&(X=M-a),V&&(W=T-a)),(!E&&W-X>10||E&&X-W>10)&&(F(S,r[S]=E?X:G(X)),F(C,r[C]=E?W:G(W))),$-Q>10&&(F(P,r[P]=R?Q:U(Q)),F(O,r[O]=R?$:U($)))}t.attr("d",_(e,r)),J(l,r)}function J(e,t){(R||E)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=H(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=q(E?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&E){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function Q(e){e.selectAll(".visual-cue").remove()}d.init(Z),V.node().onmousemove=Y}(e,R,s,t,r,z):!0===s.editable&&R.style("pointer-events",O||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void k(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=k,v(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(e){return p._offset+p.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=g.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===d)return p&&"date"===p.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,f=x-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var b=(s+c)/2,_=(u+f)/2,w=Math.abs(b-s),k=Math.abs(_-u),M="A"+w+","+k,T=b+w+","+_;return"M"+T+M+" 0 1,1 "+(b+","+(_-k))+M+" 0 0,1 "+T+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function k(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),T&&!d)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===k&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function D(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(M,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return R.call(E),D&&(L?R.on(".opacity",null):(M=0,T=!0,R.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(E)})).on("input",(function(e){this.text(e||" ").call(u.positionText,b.x,b.y)}))),R.classed("js-placeholder",T),w}}},{"../../constants/alignment":152,"../../constants/interactions":154,"../../lib":177,"../../lib/svg_text_utils":198,"../../plots/plots":263,"../../registry":272,"../color":50,"../drawing":72,d3:13,"fast-isnumeric":15}],146:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":170,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":262,"../color/attributes":49}],147:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":177,"../../plots/array_container_defaults":218,"./attributes":146,"./constants":147}],149:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(k,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:T,height:A}),this._hbarXMin=L+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>k,O=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,R=v;z+O>s&&(z=s-O);var E=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=E.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:R,width:O,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,N=u-.5,F=P?f+O+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(M||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),M||P?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||P){var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(U),P&&this.vbar.on(".drag",null).call(U)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":177,"../color":50,"../drawing":72,d3:13}],152:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],153:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],154:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],155:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],156:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],157:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],160:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],161:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":184}],162:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var M=k[1],T=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===M.length)return u;var P;M=Number(M);try{var O=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),P=O.newDate(M,O.toMonthIndex(M,T,D),A)}else P=O.newDate(M,Number(T),A)}catch(e){return u}return P?(P.toJD()-g)*f+L*d+S*p+C*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),T-=1;var z=new Date(Date.UTC(2e3,T,A,L,S));return z.setUTCFullYear(M),z.getUTCMonth()!==T||z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,M=3*d,T=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var P=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":184}],176:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],177:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function M(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var P={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(P,arguments)};var O={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(O,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;s.seedPseudoRandom=function(){R=2e9},s.pseudoRandom=function(){var e=R;return R=(69069*R+1)%4294967296,Math.abs(R-e)<429496729?s.pseudoRandom():R/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":155,"./anchor_utils":160,"./angles":161,"./array":162,"./clean_number":163,"./clear_responsive":165,"./coerce":166,"./dates":167,"./dom":168,"./extend":170,"./filter_unique":171,"./filter_visible":172,"./geometry2d":175,"./identity":176,"./is_plain_object":178,"./keyed_container":179,"./localize":180,"./loggers":181,"./make_trace_groups":182,"./matrix":183,"./mod":184,"./nested_property":185,"./noop":186,"./notifier":187,"./push_unique":190,"./regex":192,"./relative_attr":193,"./relink_private":194,"./search":195,"./stats":197,"./throttle":199,"./to_log_range":200,d3:13,"fast-isnumeric":15}],178:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],179:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":187}],182:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{d3:13}],183:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],185:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":155,"./matrix":183}],190:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":162,"fast-isnumeric":15}],198:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,T){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var P=e.attr("class")?e.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void t();var s=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:P,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===P[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===P[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===P[0]&&0!==P.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),T&&T.call(e,s),t(s)}))}))):O(),e}function O(){C.empty()||(P=e.attr("class")+"-math",C.select("svg."+P).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}y.test(t)?u():(r=e,s=[{node:e}]);for(var C=t.split(v),P=0;P|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var M=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},A=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(A,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):T[t])||e}))}function S(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],200:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":15}],201:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":252,"topojson-client":33}],202:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,M,T,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],P=u(m,f).get(),O=[],D=-1,z=C.length;for(x=0;xC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?O.push(_):T?("add"===M&&(M={}),C.splice(_,0,M),P&&P.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(O[x],1),P&&P.splice(O[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var R;if(-1===D)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x=D);x++)R.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function E(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function U(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(M.layoutReplot):Object.keys(n).length&&(G(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(M.doLegend),i.layoutstyle&&l.push(M.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(M.doTicksRelayout),i.modebar&&l.push(M.doModeBar),i.camera&&l.push(M.doCamera),i.colorbars&&l.push(M.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(e,U,[e,a.undoit],U,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function G(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,M.doAutoRangeAndConstraints,r,M.drawData,M.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=j(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(q(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],N=z.parts[E-1]+"."+I,B=z.parts.slice(0,E).join("."),H=l(e.layout,B).get(),U=l(s,B).get(),G=z.get();if(void 0!==R){M[D]=R,L[D]="reverse"===I?R:F(G);var V=f.getLayoutValObject(s,z.parts);if(V&&V.impliedEdits&&null!==R)for(var W in V.impliedEdits)S(o.relativeAttr(D,W),V.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(R){S("autosize",null);var Q="height"===D?"width":"height";S(Q,s[Q])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",R?null:s.width),S("height",R?null:s.height);else if(N.match(Z))O(N),l(s,B+"._inputRange").set(null);else if(N.match(Y)){O(N),l(s,B+"._inputRange").set(null);var $=l(s,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(X)&&l(s,B+"._inputDomain").set(null);if("type"===I){var K=H,ee="linear"===U.type&&"log"===R,te="log"===U.type&&"linear"===R;if(ee||te){if(K&&K.range)if(U.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(B+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(B+".range[0]",Math.log(re)/Math.LN10),S(B+".range[1]",Math.log(ne)/Math.LN10)):(S(B+".range[0]",Math.pow(10,re)),S(B+".range[1]",Math.pow(10,ne)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,U,R,S),u.getComponentMethod("images","convertCoords")(e,U,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(R||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=V||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(R)?L[D]=null:w.isRemoveVal(R)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=R,delete t[D]}else"reverse"===I?(H.range?H.range.reverse():(S(B+".autorange",!0),H.range=[1,0]),U.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?_.plot=!0:V?T.update(_,V):_.calc=!0,z.set(R))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in P)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ne(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&T.push(g);y=T}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,t,l)},r.getLayoutValObject=function(e,t){return b(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":177,"../plots/attributes":219}],213:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function k(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=k(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?k(u,M,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,P=l.yaxis.domain,O=l.plotgroup;if(y(C,P,L)){var D=O.node(),z=l.bg=o.ensureSingle(O,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else O.select("rect.bg").remove(),L.push([C,P]),S||(T.push(a),A.push(a))}var R,E,I,N,F,j,B,H,q,U,G,V,Z,Y=v._bgLayer.selectAll(".bg").data(T);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":177,"../plots/attributes":219,"../plots/plots":263,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var T=o.extendFlat({},d);x?T.width=x:null===t.width&&n(h.width)&&(T.width=h.width),b?T.height=b:null===t.height&&n(h.height)&&(T.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.plot(M,r,T,A).then(L).then(S).then(C).then((function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":177,"../plots/plots":263,"../snapshot/helpers":276,"../snapshot/svgtoimg":278,"../snapshot/tosvg":280,"../version":331,"./plot_api":209,"fast-isnumeric":15}],216:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var T,A,L,S,C,P=x.length,O=Array.isArray(M);if(O&&(P=Math.min(P,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(T=0;T<(O?Math.min(D,M[A].length):D);T++)L=O?M[A][T]:M,S=y[A][T],C=x[A][T],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,T),S,C)):a.push(h("value",i,m.concat(A,T),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((b=T-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/T>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/T));if(d===p){var C=d-1,P=d+1;if(k)if(0===d)i=[0,1];else{var O=(d>0?f:u).reduce((function(e,t){return Math.max(e,o(t))}),0),D=d/(1-Math.min(.5,O/T));i=d>0?[0,D]:[D,0]}else i=M?[Math.max(0,C),Math.max(1,P)]:[C,P]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):M&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(T-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,M=r.vpadLinearized||!1;function T(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=T((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":155,"../../lib":177,"../../registry":272,"fast-isnumeric":15}],222:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),M=k.MID_SHIFT,T=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),P=e("./axis_ids");S.id2name=P.id2name,S.name2id=P.name2id,S.cleanId=P.cleanId,S.list=P.list,S.listIds=P.listIds,S.getFromId=P.getFromId,S.getFromTrace=P.getFromTrace;var O=e("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes;function D(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i);return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),"array"===e.tickmode&&(a*=100),e._roughDTick=(Math.abs(r[1]-r[0])-(e._lBreaks||0))/a,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),G(e)},S.calcTicks=function(e,t){S.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=D(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var u=0;ui&&f=o:n<=o)&&!(c.length>r||n===t);n=S.tickIncrement(n,e.dtick,s,e.calendar)){t=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),e.rangebreaks){var f=c.length;if(f){var d=0;"auto"===e.tickmode&&(d=("y"===e._id.charAt(0)?2:6)*(e.tickfont?e.tickfont.size:12));for(var p,h=[],g=s?1:-1,v=s?f-1:0,m=s?0:f-1;g*m<=g*v;m+=g){var y=c[m];if(e.maskBreaks(y.value)!==w||(y.value=se(y.value,e),!e._rl||e._rl[0]!==y.value&&e._rl[1]!==y.value)){var x=e.c2p(y.value);x===p?h[h.length-1].valued)&&(p=x,h.push(y))}}c=h.reverse()}}le(e)&&360===Math.abs(r[1]-r[0])&&c.pop(),e._tmax=(c[c.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Y(e.exponentformat)&&!X(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function V(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*U(t,r,I)):i>v?(t/=v,e.dtick="M"+U(t,1,N)):i>m?(e.dtick=U(t,m,e._hasDayOfWeekBreaks?[1,2,7,14]:j),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=U(t,y,N):i>x?e.dtick=U(t,x,F):i>b?e.dtick=U(t,b,F):(r=n(10),e.dtick=U(t,r,I))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+U(t,r,I)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):le(e)?(e.tick0=0,r=1,e.dtick=U(t,r,q)):(e.tick0=0,r=n(10),e.dtick=U(t,r,I));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?H:B,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=W(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Y(p)&&X(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=W(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):le(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=W(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=W(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=W(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var Z=["f","p","n","\u03bc","m","","k","M","G","T"];function Y(e){return"SI"===e||"B"===e}function X(e){return e>14||e<-15}function W(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};G(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":Y(s)&&(e+=Z[c/3+5]));return i?_+e:e}function J(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}X&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,te(t),n),i.autoMargin(e,re(t),a),i.autoMargin(e,ne(t),l)})),r.skipTitle||X&&"bottom"===t.side||Z.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(Z)}}function W(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ee(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*M},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],Q);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||k)for(r=0;rz&&IO&&(O=I);p/=(O-P)/(2*D),P=c.l2r(P),O=c.l2r(O),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function F(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function j(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),B(e,t,a,i)}function B(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function H(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){P&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),P=!1)}function U(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(H(a),2!==e||he||He(),pe)i.indexOf("select")>-1&&T(r,a,W,J,t.id,Se),i.indexOf("event")>-1&&f.click(a,r,t.id);else if(1===e&&he){var l=g?B:O,c="s"===g||"w"===P?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;g?(h="n"===g?"top":"bottom","right"===l.side&&(p="right")):"e"===P&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(me).call(s.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,t+ye)),a=Math.max(0,Math.min(ee,r+xe)),i=Math.abs(n-ye),o=Math.abs(a-xe);function l(){Me="",be.r=be.l,be.t=be.b,Ae.attr("d","M0,0Z")}if(be.l=Math.min(ye,n),be.r=Math.max(ye,n),be.t=Math.min(xe,a),be.b=Math.max(xe,a),te.isSubplotConstrained)i>C||o>C?(Me="xy",i/K>o/ee?(o=i*ee/K,xe>a?be.t=xe-o:be.b=xe+o):(i=o*K/ee,ye>n?be.l=ye-i:be.r=ye+i),Ae.attr("d",U(be))):l();else if(re.isSubplotConstrained)if(i>C||o>C){Me="xy";var s=Math.min(be.l/K,(ee-be.b)/ee),c=Math.max(be.r/K,(ee-be.t)/ee);be.l=s*K,be.r=c*K,be.b=(1-s)*ee,be.t=(1-c)*ee,Ae.attr("d",U(be))}else l();else!ae||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":177,"fast-isnumeric":15}],240:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":152}],241:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),k=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),T=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),P=C.p2r,O=C.axValue,D=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){N(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)Y._fullLayout._deactivateShape(Y);else if(!B){var r=X.clickmode;b.done(de).then((function(){if(b.clear(de),2===e){for(se.remove(),w=0;w-1&&z(t,Y,a.xaxes,a.yaxes,a.subplot,a,se),"event"===r&&Y.emit("plotly_selected",void 0);l.click(Y,t)})).catch(y.error)}},a.doneFn=function(){fe.remove(),b.done(de).then((function(){b.clear(de),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=le,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pe)})).catch(y.error),B&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:z}},{"../../components/color":50,"../../components/dragelement/helpers":68,"../../components/drawing":72,"../../components/fx":90,"../../components/fx/helpers":86,"../../components/shapes/draw_newshape/display_outlines":135,"../../components/shapes/draw_newshape/helpers":136,"../../components/shapes/draw_newshape/newshapes":137,"../../lib":177,"../../lib/clear_gl_canvases":164,"../../lib/polygon":189,"../../lib/throttle":199,"../../plot_api/subroutines":213,"../../registry":272,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:23}],242:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function M(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function T(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n,o){var l=s(t,n||e.calendar);if(l===p){if(!a(t))return p;if(t=+t,(o||{}).msUTC)return t;var c=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-c/10);l=s(new Date(u))+c/10}return l}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(M(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function O(e){var t=P(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var R=function(t){return a(t)?D(t,e._m,e._b):p},E=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;R=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},E=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?T:c,e.l2c="log"===e.type?k:c,e.l2p=R,e.p2l=E,e.c2p="log"===e.type?function(e,t){return R(T(e,t))}:R,e.p2c="log"===e.type?function(e){return k(E(e))}:E,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=E,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return T(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=T,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(E(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=E,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(E(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=c,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,la&&(a+=24,l=n&&l=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,M=f?p[0]:0,T=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,M,T).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":72,"../../lib":177,"../../registry":272,"./axes":222,d3:13}],247:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new _(e)},w.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var l in m.layerNameToAdjective)if("frame"!==l&&a["show"+l]){o=!0;break}for(var s=0;s0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),c.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this.render()}},w.updateProjection=function(e,t){var r=this.graphDiv,o=t[this.id],l=t._size,s=o.domain,c=o.projection,u=o.lonaxis,d=o.lataxis,p=u._ax,h=d._ax,g=this.projection=function(e){for(var t=e.projection.type,r=n.geo[m.projNames[t]](),a=e._isClipped?m.lonaxisSpan[t]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(e){return e?r:[]},l=0;la*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(e){return r.getPath().bounds(e)},r.fitExtent=function(e,t){var n=e[1][0]-e[0][0],a=e[1][1]-e[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(t),l=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),s=+e[0][0]+(n-l*(o[1][0]+o[0][0]))/2,c=+e[0][1]+(a-l*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*l).translate([s,c])},r.precision(m.precision),a&&r.clipAngle(a-m.clipPad);return r}(o),v=[[l.l+l.w*s.x[0],l.t+l.h*(1-s.y[1])],[l.l+l.w*s.x[1],l.t+l.h*(1-s.y[0])]],y=o.center||{},x=c.rotation||{},b=u.range||[],_=d.range||[];if(o.fitbounds){p._length=v[1][0]-v[0][0],h._length=v[1][1]-v[0][1],p.range=f(r,p),h.range=f(r,h);var w=(p.range[0]+p.range[1])/2,M=(h.range[0]+h.range[1])/2;if(o._isScoped)y={lon:w,lat:M};else if(o._isClipped){y={lon:w,lat:M},x={lon:w,lat:M,roll:x.roll};var T=c.type,A=m.lonaxisSpan[T]/2||180,L=m.lataxisSpan[T]/2||180;b=[w-A,w+A],_=[M-L,M+L]}else y={lon:w,lat:M},x={lon:w,lat:x.lat,roll:x.roll}}g.center([y.lon-x.lon,y.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(c.parallels);var S=k(b,_);g.fitExtent(v,S);var C=this.bounds=g.getBounds(S),P=this.fitScale=g.scale(),O=g.translate();if(!isFinite(C[0][0])||!isFinite(C[0][1])||!isFinite(C[1][0])||!isFinite(C[1][1])||isNaN(O[0])||isNaN(O[0])){for(var D=["fitbounds","projection.rotation","center","lonaxis.range","lataxis.range"],z="Invalid geo settings, relayout'ing to default view.",R={},E=0;E-1&&g(n.event,i,[r.xaxis],[r.yaxis],r.id,f),c.indexOf("event")>-1&&s.click(i,n.event))}))}function m(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},w.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(l.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(e.mockAxis,r)},w.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},i.extendFlat(this.viewInitial,t)},w.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":50,"../../components/dragelement":69,"../../components/drawing":72,"../../components/fx":90,"../../lib":177,"../../lib/geo_location_utils":173,"../../lib/topojson_utils":201,"../../registry":272,"../cartesian/autorange":221,"../cartesian/axes":222,"../cartesian/select":241,"../plots":263,"./constants":252,"./projections":257,"./zoom":258,d3:13,"topojson-client":33}],254:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&P<0&&(P+=360);var O,D,z,R=(C+P)/2;if(!p){var E=h?f.projRotate:[R,0,0];O=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!h&&y)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!y&&void 0)&&r("oceancolor")}(p?(D=-96.6,z=38.7):(D=h?R:O,z=(S[0]+S[1])/2),r("center.lon",D),r("center.lat",z),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!y&&void 0)&&r("landcolor"),r("showlakes",!!y&&void 0)&&r("lakecolor"),r("showrivers",!!y&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&y)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",y),r("subunitcolor"),r("subunitwidth")),h||r("showframe",y)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):v?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":177,"../get_data":259,"../subplot_defaults":270,"./constants":252,"./layout_attributes":255}],257:[function(e,t,r){"use strict";t.exports=function(e){function t(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:r(e.geometry,t)}}function r(t,n){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map((function(e){return r(e,n)}))};if(!c.hasOwnProperty(t.type))return null;var a=c[t.type];return e.geo.stream(t,n(a)),a.result()}e.geo.project=function(e,t){var a=t.stream;if(!a)throw new Error("not yet supported");return(e&&n.hasOwnProperty(e.type)?n[e.type]:r)(e,a)};var n={Feature:t,FeatureCollection:function(e,r){return{type:"FeatureCollection",features:e.features.map((function(e){return t(e,r)}))}}},a=[],i=[],o={point:function(e,t){a.push([e,t])},result:function(){var e=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],e}},l={lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var e=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],e}},s={polygonStart:u,lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){var e=a.length;if(e){do{a.push(a[0].slice())}while(++e<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var e=[],t=[];return i.forEach((function(r){!function(e){if((t=e.length)<4)return!1;var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];for(;++rn^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0}))||e.push([t])})),i=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}},c={Point:o,MultiPoint:o,LineString:l,MultiLineString:l,Polygon:s,MultiPolygon:s,Sphere:s};function u(){}var f=1e-6,d=Math.PI,p=d/2,h=(Math.sqrt(d),d/180),g=180/d;function v(e){return e>1?p:e<-1?-p:Math.asin(e)}function m(e){return e>1?0:e<-1?d:Math.acos(e)}var y=e.geo.projection,x=e.geo.projectionMutator;function b(e,t){var r=(2+p)*Math.sin(t);t/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>f;n++){var i=Math.cos(t);t-=a=(t+Math.sin(t)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(d*(4+d))*e*(1+Math.cos(t)),2*Math.sqrt(d/(4+d))*Math.sin(t)]}e.geo.interrupt=function(t){var r,n=[[[[-d,0],[0,p],[d,0]]],[[[-d,0],[0,-p],[d,0]]]];function a(e,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,l=i.length-1;oi[o][2][0];++o);var s=t(e-i[o][1][0],r);return s[0]+=t(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],s}function i(){r=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],a=t(e[2][0],e[2][1])[0],i=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))}))}t.invert&&(a.invert=function(e,i){for(var o=r[+(i<0)],l=n[+(i<0)],s=0,u=o.length;s=0;--a){var p;o=180*(p=n[1][a])[0][0]/d,l=180*p[0][1]/d,c=180*p[1][1]/d,u=180*p[2][0]/d,f=180*p[2][1]/d;r.push(s([[u-t,f-t],[u-t,c+t],[o+t,c+t],[o+t,l-t]],30))}return{type:"Polygon",coordinates:[e.merge(r)]}}(),i)},a},o.lobes=function(e){return arguments.length?(n=e.map((function(e){return e.map((function(e){return[[e[0][0]*d/180,e[0][1]*d/180],[e[1][0]*d/180,e[1][1]*d/180],[e[2][0]*d/180,e[2][1]*d/180]]}))})),i(),o):n.map((function(e){return e.map((function(e){return[[180*e[0][0]/d,180*e[0][1]/d],[180*e[1][0]/d,180*e[1][1]/d],[180*e[2][0]/d,180*e[2][1]/d]]}))}))},o},b.invert=function(e,t){var r=.5*t*Math.sqrt((4+d)/d),n=v(r),a=Math.cos(n);return[e/(2/Math.sqrt(d*(4+d))*(1+a)),v((n+r*(a+2))/(2+p))]},(e.geo.eckert4=function(){return y(b)}).raw=b;var _=e.geo.azimuthalEqualArea.raw;function w(e,t){if(arguments.length<2&&(t=e),1===t)return _;if(t===1/0)return k;function r(r,n){var a=_(r/t,n);return a[0]*=e,a}return r.invert=function(r,n){var a=_.invert(r/e,n);return a[0]*=t,a},r}function k(e,t){return[e*Math.cos(t)/Math.cos(t/=2),2*Math.sin(t)]}function M(e,t){return[3*e/(2*d)*Math.sqrt(d*d/3-t*t),t]}function T(e,t){return[e,1.25*Math.log(Math.tan(d/4+.4*t))]}function A(e){return function(t){var r,n=e*Math.sin(t),a=30;do{t-=r=(t+Math.sin(t)-n)/(1+Math.cos(t))}while(Math.abs(r)>f&&--a>0);return t/2}}k.invert=function(e,t){var r=2*v(t/2);return[e*Math.cos(r/2)/Math.cos(r),r]},(e.geo.hammer=function(){var e=2,t=x(w),r=t(e);return r.coefficient=function(r){return arguments.length?t(e=+r):e},r}).raw=w,M.invert=function(e,t){return[2/3*d*e/Math.sqrt(d*d/3-t*t),t]},(e.geo.kavrayskiy7=function(){return y(M)}).raw=M,T.invert=function(e,t){return[e,2.5*Math.atan(Math.exp(.8*t))-.625*d]},(e.geo.miller=function(){return y(T)}).raw=T,A(d);var L=function(e,t,r){var n=A(r);function a(r,a){return[e*r*Math.cos(a=n(a)),t*Math.sin(a)]}return a.invert=function(n,a){var i=v(a/t);return[n/(e*Math.cos(i)),v((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/p,Math.SQRT2,d);function S(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(e.geo.mollweide=function(){return y(L)}).raw=L,S.invert=function(e,t){var r,n=t,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-t)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(e.geo.naturalEarth=function(){return y(S)}).raw=S;var C=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function P(e,t){var r,n=Math.min(18,36*Math.abs(t)/d),a=Math.floor(n),i=n-a,o=(r=C[a])[0],l=r[1],s=(r=C[++a])[0],c=r[1],u=(r=C[Math.min(19,++a)])[0],f=r[1];return[e*(s+i*(u-o)/2+i*i*(u-2*s+o)/2),(t>0?p:-p)*(c+i*(f-l)/2+i*i*(f-2*c+l)/2)]}function O(e,t){return[e*Math.cos(t),t]}function D(e,t){var r,n=Math.cos(t),a=(r=m(n*Math.cos(e/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(e)*a,Math.sin(t)*a]}function z(e,t){var r=D(e,t);return[(r[0]+e/p)/2,(r[1]+t)/2]}C.forEach((function(e){e[1]*=1.0144})),P.invert=function(e,t){var r=t/p,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=C[i][1],l=C[i+1][1],s=C[Math.min(19,i+2)][1],c=s-o,u=s-2*l+o,f=2*(Math.abs(r)-l)/c,d=u/c,v=f*(1-d*f*(1-2*d*f));if(v>=0||1===i){n=(t>=0?5:-5)*(v+a);var m,y=50;do{v=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=C[i][1],l=C[i+1][1],s=C[Math.min(19,i+2)][1],n-=(m=(t>=0?p:-p)*(l+v*(s-o)/2+v*v*(s-2*l+o)/2)-t)*g}while(Math.abs(m)>1e-12&&--y>0);break}}while(--i>=0);var x=C[i][0],b=C[i+1][0],_=C[Math.min(19,i+2)][0];return[e/(b+v*(_-x)/2+v*v*(_-2*b+x)/2),n*h]},(e.geo.robinson=function(){return y(P)}).raw=P,O.invert=function(e,t){return[e/Math.cos(t),t]},(e.geo.sinusoidal=function(){return y(O)}).raw=O,D.invert=function(e,t){if(!(e*e+4*t*t>d*d+f)){var r=e,n=t,a=25;do{var i,o=Math.sin(r),l=Math.sin(r/2),s=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),p=Math.sin(2*n),h=c*c,g=u*u,v=l*l,y=1-g*s*s,x=y?m(u*s)*Math.sqrt(i=1/y):i=0,b=2*x*u*l-e,_=x*c-t,w=i*(g*v+x*u*s*h),k=i*(.5*o*p-2*x*c*l),M=.25*i*(p*l-x*c*g*o),T=i*(h*s+x*v*u),A=k*M-T*w;if(!A)break;var L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]}},(e.geo.aitoff=function(){return y(D)}).raw=D,z.invert=function(e,t){var r=e,n=t,a=25;do{var i,o=Math.cos(n),l=Math.sin(n),s=Math.sin(2*n),c=l*l,u=o*o,d=Math.sin(r),h=Math.cos(r/2),g=Math.sin(r/2),v=g*g,y=1-u*h*h,x=y?m(o*h)*Math.sqrt(i=1/y):i=0,b=.5*(2*x*o*g+r/p)-e,_=.5*(x*l+n)-t,w=.5*i*(u*v+x*o*h*c)+.5/p,k=i*(d*s/4-x*l*g),M=.125*i*(s*g-x*l*u*d),T=.5*i*(c*h+x*v*o)+.5,A=k*M-T*w,L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]},(e.geo.winkel3=function(){return y(z)}).raw=z}},{}],258:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render();var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return b(r[0],r[1],i,v)<=b(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function b(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function k(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function M(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){y.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),y.linkSubplots(f,l,u,a),y.cleanPlot(f,l,u,a);var F=!(!a._has||!a._has("gl2d")),j=!(!l._has||!l._has("gl2d")),B=!(!a._has||!a._has("cartesian"))||F,H=!(!l._has||!l._has("cartesian"))||j;B&&!H?a._bgLayer.remove():H&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&d({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return y.doAutoMargin(e)}},y.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),S(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var m in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[m].l||{},b=h[m].b||{},_=x.val,w=x.size,k=b.val,M=b.size;for(var T in h){if(a(w)&&h[T].r){var A=h[T].r.val,L=h[T].r.size;if(A>_){var C=(w*A+(L-d)*_)/(A-_),P=(L*(1-_)+(w-d)*(1-A))/(A-_);C>=0&&P>=0&&d-(C+P)>0&&C+P>l+c&&(l=C,c=P)}}if(a(M)&&h[T].t){var O=h[T].t.val,D=h[T].t.size;if(O>k){var z=(M*O+(D-p)*k)/(O-k),R=(D*(1-k)+(M-p)*(1-O))/(O-k);z>=0&&R>=0&&p-(R+z)>0&&z+R>f+u&&(f=z,u=R)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var E=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return i.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var o=0,l=0;function s(){return o++,function(){l++,n||l!==o||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then((function(){return e}))}y.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},y.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&y.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return u(e,t)})):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(D(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);T&&!M&&(S=0);var C=L.slice();A&&M&&(C[1]+=S);var P=d.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),d.angularAxis.ticksStep&&(P=(C[1]-C[0])/P);var O=d.angularAxis.ticksStep||(C[1]-C[0])/(P*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.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 E,I=e.select(".chart-group"),N={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){E=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map((function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r}));o.Legend().config({data:p.map((function(e,t){return e.name||"Element"+t})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:E,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=E.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),E.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else E=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),d.title&&d.title.text){var q=e.select("g.title-group text").style(F).text(d.title.text),U=q.node().getBBox();q.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var G=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var V=G.selectAll("circle.grid-circle").data(r.ticks(5));V.enter().append("circle").attr({class:"grid-circle"}).style(N),V.attr("r",r),V.exit().remove()}G.select("circle.outside-circle").attr({r:x}).style(N);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),G.selectAll(".domain").style(N),G.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(e,t){return t%(d.minorTicks+1)==0})).classed("minor",(function(e,t){return!(t%(d.minorTicks+1)==0)})).style(N),J.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(F);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(F);d.angularAxis.rewriteTicks&&Q.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));E.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.forEach((function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map((function(e,t){return a(o[r].defaultConfig(),e)}));o[r]().config(n)()}))}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!M){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()})),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach((function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map((function(t,r){var n=t*Math.PI/180;return[t,e(n)]}))},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach((function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map((function(e,t){return r[t]||r[0]}))},o.util.fillArrays=function(e,t,r){return t.forEach((function(t,n){e[t]=o.util.ensureArray(e[t],r)})),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map((function(e,t){return n.sum(e)}))},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter((function(e,t,r){return r.indexOf(e)==t}))},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(e){return-d/2})).endAngle((function(e){return d/2})).innerRadius((function(e){return t.radialScale(s+(e[2]||0))})).outerRadius((function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])}));c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={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,n,a){return r[e[a].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"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(e,t){return e}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(t){return arguments.length?(t.forEach((function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)})),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map((function(e,r){return[].concat(e).map((function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)})),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(e,t){return e.color})),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text((function(e,t){return o[t].name})),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map((function(e,r){var n=a({},e);return[[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"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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})),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map((function(e,t){return e.geometry})));r.data.forEach((function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)}))}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(e,r){o.util.translator.apply(null,e.concat(t))})),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(e,t){u[c[s.indexOf(e.key)]]=e.value})),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":152,"../../../lib":177,d3:13}],268:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":50,"../../../lib":177,"./micropolar":267,"./undo_manager":269,d3:13}],269:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n||(t.splice(r+1,t.length-r),t.push(e),r=t.length-1),this},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":50,"../components/drawing":72,"../constants/xmlns_namespaces":156,"../lib":177,d3:13}],281:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":49,"../../components/colorscale/attributes":57,"../../lib/extend":170,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattergeo/attributes":321}],282:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o,d.mockAxis),[e]}},{"../../lib":177,"../../plots/cartesian/axes":222,"./attributes":281}],286:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":254,"../heatmap/colorbar":290,"./attributes":281,"./calc":282,"./defaults":283,"./event_data":284,"./hover":285,"./plot":287,"./select":288,"./style":289}],287:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;pl&&T[v].gap;)v--;for(y=T[v].s,h=T.length-1;h>v;h--)T[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],301:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mV!=(N=D[P][1])>=V&&(R=D[P-1][0],E=D[P][0],N-I&&(z=R+(E-R)*(V-I)/(N-I),H=Math.min(H,z),q=Math.max(q,z)));H=Math.max(H,0),q=Math.min(q,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:H,x1:q,y0:V,y1:V,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":50,"../../components/fx":90,"../../lib":177,"../../registry":272,"./get_trace_color":304}],306:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":293,"./attributes":294,"./calc":295,"./cross_trace_calc":299,"./cross_trace_defaults":300,"./defaults":301,"./format_labels":303,"./hover":305,"./marker_colorbar":312,"./plot":314,"./select":315,"./style":317,"./subtypes":318}],307:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"../../lib":177}],308:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,M,T,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,P="log"===S.type,O=L._length,D=S._length,z=t.connectGaps,R=t.baseTolerance,E=t.shape,I="linear"===E,N=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),q=0;function U(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;P&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*O*(S._m>0?o:l)))),i*=1e3}if(s===a){if(P&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function G(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[q-1][0],a=r===H[q-1][1];if(!n||!a)if(q>1){var i=t===H[q-2][0],o=r===H[q-2][1];n&&(t===te||t===re)&&i?o?q--:H[q-1]=e:a&&(r===ne||r===ae)&&o?i?q--:H[q-1]=e:H[q++]=e}else H[q++]=e}function ue(e){H[q-1][0]!==e[0]&&H[q-1][1]!==e[1]&&ce([W,J]),ce(e),Q=null,W=J=0}function fe(e){if(T=e[0]/O,A=e[1]/D,Y=e[0]re?re:0,X=e[1]ae?ae:0,Y||X){if(q)if(Q){var t=K(Q,e);t.length>1&&(ue(t[0]),H[q++]=t[1])}else $=K(H[q-1],e)[0],H[q++]=$;else H[q++]=[Y||e[0],X||e[1]];var r=H[q-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(Q&&(W!==Y&&J!==X?ce(W&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,J||X]):W&&J&&ce([W,J])),ce([Y,X])):W-Y&&J-X&&ce([Y||W,X||J]),Q=e,W=Y,J=X}else Q&&ue(K(Q,e)[0]),H[q++]=e;var n,a,i,o}for("linear"===E||"spline"===E?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)V(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}Q&&ce([W||Q[0],J||Q[1]]),F.push(H.slice(0,q))}return F}},{"../../constants/numerical":155,"../../lib":177,"./constants":298}],309:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],310:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":15}],312:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],313:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"./subtypes":318}],314:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),M=o(k,"g","errorbars"),T=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var P=_.fill.charAt(_.fill.length-1);"x"!==P&&"y"!==P&&(P=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var O,D,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,N,F,j,B,H,q,U="",G="",V=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):I=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),q=_._polygons=new Array(V.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),s.singleLineStyle(f,a)}}}}}var Y=T.selectAll(".js-line").data(V);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(P?("y"===P?j[1]=H[1]=b.c2p(0,!0):"x"===P&&(j[0]=H[0]=x.c2p(0,!0)),y(S).attr("d","M"+H+"L"+j+"L"+U.substr(1)).call(s.singleFillStyle)):y(S).attr("d",U+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&U&&z?("tonext"===_.fill?y(C).attr("d",U+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",U+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=q):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var k,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":72,"../../lib":177,"../../lib/polygon":189,"../../registry":272,"./line_points":308,"./link_traces":310,"./subtypes":318,d3:13}],315:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":90,"../../constants/numerical":155,"../../lib":177,"../scatter/get_trace_color":304,"./attributes":321}],327:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":254,"../scatter/marker_colorbar":312,"../scatter/style":317,"./attributes":321,"./calc":322,"./defaults":323,"./event_data":324,"./format_labels":325,"./hover":326,"./plot":328,"./select":329,"./style":330}],328:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;r 0) { var factor = 1 - 2 * frameMargins; @@ -118059,7 +118068,7 @@ module.exports = function select(searchInfo, selectionTester) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[5])(5) }); diff --git a/dist/plotly-gl2d.min.js b/dist/plotly-gl2d.min.js index 837a5978e0e..b2e9d77984e 100644 --- a/dist/plotly-gl2d.min.js +++ b/dist/plotly-gl2d.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (gl2d - minified) v1.54.2 +* plotly.js (gl2d - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -58,4 +58,4 @@ var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t(" * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,a="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||"undefined"==typeof n)n=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],261:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],269:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],270:[function(t,e,r){"use strict";var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return v(0,M-1),M-=1,b(0),t}return-1}function w(t,e){var r=k[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((M+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}var k=[],T=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=T[e],a=T[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:S,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":262,"simplicial-complex":270}],273:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,i),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":273,"binary-search-bounds":274,"functional-red-black-tree":156,"robust-orientation":262}],276:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],277:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;i.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var M=p[x].length/y*.5,E=.5+m[x]/y*.5;k.push("d"+x+"-"+E+"-"+M+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}i.push("}},"),f.length>0&&h.push("}}");var S=[];for(u=0;u<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===c||0===f)return[];var b=Math.sin(d*a/360),x=Math.cos(d*a/360),_=x*(e-l)/2+b*(r-u)/2,w=-b*(e-l)/2+x*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var k=function(t,e,r,n,i,o,l,u,c,f,h,d){var p=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===u?-1:1))*i/o*d,x=y*-o/i*h,_=f*b-c*x+(t+r)/2,w=c*b+f*x+(e+n)/2,A=(h-b)/i,k=(d-x)/o,T=(-h-b)/i,M=(-d-x)/o,E=s(1,0,A,k),S=s(A,k,T,M);return 0===u&&S>0&&(S-=a),1===u&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,u,c,f,g,m,b,x,_,w),T=n(k,4),M=T[0],E=T[1],S=T[2],C=T[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var D=0;De[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":10,assert:15,"is-svg-path":213,"normalize-svg-path":281,"parse-svg-path":228}],281:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":279}],282:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||a(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d));if(c.translate(.5*r,.5*f),c.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),d&&c.stroke(m)}else{var y=i(t);o(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":39,"draw-svg-path":87,"is-svg-path":213,"parse-svg-path":228,"svg-path-bounds":280}],283:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(f+=.02);var d=new Float32Array(c),p=0,g=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=C(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16)),R(P(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var z,N,B,j=(N="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",B="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],285:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":292}],294:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":300}],295:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":291,"./is":296}],296:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":290}],297:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":294}],298:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":294,"../value/is":300}],299:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":291,"./is":300}],300:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],301:[function(t,e,r){(function(e){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=e.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=a([32,0])),u.BIGUINT64||(u.BIGUINT64=a([32,0])),u.BIGINT64||(u.BIGINT64=a([32,0])),u.BUFFER||(u.BUFFER=a([32,0]));var c=u.DATA,f=u.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function k(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=k,r.mallocDataView=T,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":38,buffer:50,dup:89}],302:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":77}],313:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":312}],314:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],315:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":495,"../../plots/cartesian/constants":511,"../../plots/font_attributes":533,"./arrow_paths":314}],316:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":458,"../../plots/cartesian/axes":505,"./draw":321}],317:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var G=!1,q=["x","y"],X=0;X1)&&(tt===K?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(G=!0):G=!0),W=et._offset+et.r2p(e[$]),J=.5}else"x"===$?(Z=e[$],W=x.l+x.w*Z):(Z=1-e[$],W=x.t+x.h*Z),J=e.showarrow?.5:Z;if(e.showarrow){lt.head=W;var ct=e["a"+$];Q=nt*U(.5,e.xanchor)-at*U(.5,e.yanchor),tt===K?(lt.tail=et._offset+et.r2p(ct),Y=Q):(lt.tail=W+ct,Y=Q+ct),lt.text=lt.tail+Q;var ft=b["x"===$?"width":"height"];if("paper"===K&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),dt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):dt>0&&(lt.tail-=dt,lt.text-=dt)}lt.tail+=st,lt.head+=st}else Y=Q=it*U(J,ot),lt.text=W+Q;lt.text+=st,Q+=st,Y+=st,e["_"+$+"padplus"]=it/2+Y,e["_"+$+"padminus"]=it/2-Y,e["_"+$+"size"]=it,e["_"+$+"shift"]=Q}if(G)R.remove();else{var pt=0,gt=0;if("left"!==e.align&&(pt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(D-y)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:F+pt-1,y:F+gt}).call(u.setClipUrl,N?M:null,t);else{var vt=F+gt-p.top,mt=F+pt-p.left;V.call(f.positionText,mt,vt).call(u.setClipUrl,N?M:null,t)}B.select("rect").call(u.setRect,F,F,w,D),z.call(u.setRect,I/2,I/2,P-I,j-I),R.call(u.setTranslate,Math.round(E.x.text-P/2),Math.round(E.y.text-j/2)),L.attr({transform:"rotate("+S+","+E.x.text+","+E.y.text+")"});var yt,bt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,p=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,b=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),O=+z.attr("width"),D=+z.attr("height"),I=m-.5*O,P=I+O,F=y-.5*D,N=F+D,B=[[I,F,I,N],[I,N,P,N],[P,N,P,F],[P,F,I,F]].map(M);if(!B.reduce((function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){B.forEach((function(t){var e=o.segmentsIntersect(h,p,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var j=e.arrowwidth,U=e.arrowcolor,V=e.arrowside,H=C.append("g").style({opacity:l.opacity(U)}).classed("annotation-arrow-g",!0),G=H.append("path").attr("d","M"+h+","+p+"L"+c+","+f).style("stroke-width",j+"px").call(l.stroke,l.rgb(U));if(g(G,V,e),_.annotationPosition&&G.node().parentNode&&!i){var q=c,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-p,2));q+=e.standoff*(h-c)/W,X+=e.standoff*(p-f)/W}var Y,Z,J=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-q)+","+(p-X),transform:"translate("+q+","+X+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:J.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);Y=t.x,Z=t.y,s&&s.autorange&&A(s._name+".autorange",!0),v&&v.autorange&&A(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,Z),a=n[0]+t,i=n[1]+r;R.call(u.setTranslate,a,i),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),k("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&bt(0,0),O)d.init({element:R.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",v.p2r(v.r2p(e.ay)+r)):k("ay",e.ay+r),bt(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;a=d.align(u+t/x.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var c=e._ysize/x.h,f=e.y-(e._yshift+e.yshift)/x.h-c/2;o=d.align(f-r/x.h,c,0,1,e.yanchor)}k("x",a),k("y",o),s&&v||(n=d.getCursor(s?.5:a,v?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),h(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",H(n))},doneFn:function(){h(R),a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void O();if(m){if(m*m>b*b+x*x)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void O();var A=y*Math.cos(l),k=y*Math.sin(l);o.x-=A,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),M="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":540,"../annotations/draw":321}],328:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));X*=Z*u.roundUp(Y/Z,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=X}q.domain=[V+B,V+F-B],q.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,Q=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+k.cbaxis),K=0;function tt(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(r,n,c(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+z)*l.w,n=q.title.font.size;t="top"===T?(1-(V+F-B))*l.h+l.t+3+.75*n:(1-(V+B))*l.h+l.t-3-.25*n,tt(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=t.select("."+k.cbtitle),o=i.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=i.select(".h"+q._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*_),f?(K=h.bBox(f).height)>d&&(c[1]-=(K-d)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=h.bBox(o.node()).height),K){if(K+=5,"top"===T)q.domain[1]-=K/l.h,c[1]*=-1;else{q.domain[0]+=K/l.h;var p=g.lineCount(o);c[1]+=(1-p)*d}i.attr("transform","translate("+c+")"),q.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-q.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(O);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=M.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));m.each((function(t,i){var o=[0===i?M[0]:(O[i]+O[i-1])/2,i===O.length-1?M[1]:(O[i]+O[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=S(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var b=t.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?D:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(q.c2p(t))+v.width/2%1)+"h"+R).call(h.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var x=j+R+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(q),A=s.makeTransFn(q),C=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,w):w,layer:$,path:s.makeTickPath(q,x,C),transFn:A}),s.drawLabels(r,q,{vals:w,layer:$,transFn:A,labelFns:s.makeLabelFns(q,x)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));tt("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+e.outlinewidth/2+h.bBox($.node()).width;if((J=Q.select("text")).node()&&!J.classed(k.jsPlaceholder)){var a,o=Q.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(Q.node()).right-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-G;t.select("."+k.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:j,y:G+e.ypad+("top"===T?K:0),width:Math.max(R,2),height:Math.max(u-2*e.ypad-K,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},p=w[e.yanchor],g=A[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*p,f.b=u*g):(f.t=f.b=0,f.yt=e.y+e.len*p,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=A[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*m;else{var y=s-R;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}i.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);f(t,u)},doneFn:function(){if(f(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":432,"../../lib":458,"../../lib/extend":451,"../../lib/setcursor":478,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"../../plots/cartesian/axis_defaults":507,"../../plots/cartesian/layout_attributes":519,"../../plots/cartesian/position_defaults":522,"../../plots/plots":543,"../../registry":551,"../color":330,"../colorscale/helpers":341,"../dragelement":349,"../drawing":352,"../titles":425,"./constants":332,d3:83,tinycolor2:284}],335:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":458}],336:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":331,"./defaults":333,"./draw":334,"./has_colorbar":335}],337:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var d=s+"auto",p=s+"min",g=s+"max",v=s+"mid",m=(o(h+d),o(h+p),o(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":474,"../colorbar/attributes":331,"./scales.js":345}],338:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":458,"./helpers":341,"fast-isnumeric":152}],339:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],347:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":458}],348:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],349:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":458,"../../plots/cartesian/constants":511,"./align":346,"./cursor":347,"./unhover":350,"has-hover":200,"has-passive-events":201,"mouse-event-offset":216}],350:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":449,"../../lib/events":450,"../../lib/throttle":483,"../fx/constants":364}],351:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],352:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,m=e.exports={};m.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,a){t.call(m.setPosition,e,r).call(m.setSize,n,a)},m.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);m.translatePoint(t,a,e,r)}))},m.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,u=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){m.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},m.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(m.dashLine,l,o)}))},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;m.symbolList.push(r,t,r+100,t+"-open"),m.symbolNames[r]=t,m.symbolFuncs[r]=e.f,e.needLine&&(m.symbolNeedLines[r]=!0),e.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(m.symbolNoFill[r]=!0)}));var b=m.symbolNames.length;function x(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.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=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},A=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(t,e,r,a,o,l){for(var c=o.length,f=k[a],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},m.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},m.pointStyle=function(t,e,r){if(t.size()){var a=m.makePointStyleFns(e);t.each((function(t){m.singlePointStyle(t,n.select(this),e,a,r)}))}},m.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=m.symbolNumber(t.mx||i.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so)d=o.outlierwidth,h=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(i.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=i.gradient,y=t.mgt;if(y?p=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var b=t.mgc;b?p=!0:b=v.color;var _=r.uid;p&&(_+="-"+t.i),m.gradient(e,a,_,y,[[0,b],[1,f]],"fill")}else s.fill(e,f);d&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,c=i.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=a.color,v=i.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,b=i.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,u=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",x(m.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=m.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var i=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var f=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};v(h,e,t.i);var d=e._meta||{};l=u.texttemplateString(l,f,s._d3locale,h,t,d)}var p=t.tp||e.textposition,g=E(t,e),y=a?a(t):t.tc||e.textfont.color;i.call(m.font,t.tf||e.textfont.family,g,y).text(l).call(c.convertToTspans,r).call(M,p,g,t.mrc)}else i.remove()}))}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=E(t,e);s.fill(a,i),M(a,o,l,t.mrc2||t.mrc)}))}};function S(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,u.extendFlat({},v)},m.setClipUrl=function(t,e,r){t.attr("clip-path",R(e,r))},m.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},m.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var I=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(I,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var P=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(P);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":366,"../../constants/alignment":432,"../../constants/interactions":435,"../../constants/xmlns_namespaces":437,"../../lib":458,"../../lib/svg_text_utils":482,"../../registry":551,"../../traces/scatter/make_bubble_size_func":630,"../../traces/scatter/subtypes":637,"../color":330,"../colorscale":342,"./symbol_defs":353,d3:83,"fast-isnumeric":152,tinycolor2:284}],353:[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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:83}],354:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],355:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(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),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":637,"../drawing":352,d3:83,"fast-isnumeric":152}],360:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":330,d3:83}],361:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":451,"../../plots/font_attributes":533,"./layout_attributes":371}],362:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=K+x[0]._offset,e.pointerY=tt+w[0]._offset,I="xval"in e?g.flat(l,e.xval):g.p2c(x,K),P="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!a(I[0])||!a(P[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(z=0;zX&&(Z.splice(0,X),rt=Z[0].distance),m&&0!==Y&&0===Z.length){q.distance=Y,q.index=!1;var h=B._module.hoverPoints(q,H,G,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=Y}))),h&&h.length){var d,p=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(d=it(v),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>d.spikeDistance)&&(Q.vLinePoint=d))}var y=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(d=it(b),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>d.spikeDistance)&&(Q.hLinePoint=d))}}}}}function at(t,e){for(var r,n=null,a=1/0,i=0;i1||Z.length>1)||"closest"===C&&$&&Z.length>1,Tt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Mt={hovermode:C,rotateLabels:kt,bgColor:Tt,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Et=S(Z,Mt,t);g.isUnifiedHover(C)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var w=x[s],A=w.datum;A.offset=w.dp,A.del=w.del}}}(Et,kt?"xa":"ya",c),L(Et,kt));if(e.target&&e.target.tagName){var St=p.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),St?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,bt))return;bt&&t.emit("plotly_unhover",{event:e,points:bt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:I,yvals:P})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:o},l=S(a,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function S(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},x=e.fontFamily||v.HOVERFONT,_=e.fontSize||v.HOVERFONTSIZE,w=t[0],A=w.xa,E=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",L=w[S],O=(String(L)||"").split(" ")[0],D=d.node().getBoundingClientRect(),R=D.top,I=D.width,P=D.height,F=void 0!==L&&w.distance<=e.hoverdistance&&("x"===i||"y"===i);if(F){var z,N,B=!0;for(z=0;za.width-S?(m=a.width-S,s.attr("d","M"+(S-k)+",0L"+S+","+M+k+"v"+M+(2*T+b.height)+"H-"+S+"V"+M+k+"H"+(S-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(T+b.width/2)+"v"+M+(2*T+b.height)+"H-"+(T+b.width/2)+"V"+M+k+"H-"+k+"Z")}else{var C,O,D;"right"===E.side?(C="start",O=1,D="",m=A._offset+A._length):(C="end",O=-1,D="-",m=A._offset),y=E._offset+(w.y0+w.y1)/2,u.attr("text-anchor",C),s.attr("d","M0,0L"+D+k+","+k+"V"+(T+b.height/2)+"h"+D+(2*T+b.width)+"V-"+(T+b.height/2)+"H"+D+k+"V-"+k+"Z");var I,P=b.height/2,F=R-b.top-P,z="clip"+a._uid+"commonlabel"+E._id;if(m=0?K-=rt:K+=2*T;var nt=et.height+2*T,at=$+nt>=P;return nt<=P&&($<=R?$=E._offset+2*T:at&&($=P-nt)),tt.attr("transform","translate("+K+","+$+")"),tt}var it=h.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return it.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,_)})),it.exit().remove(),it.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=f.combine(f.opacity(o)?o:f.defaultLine,u),d=f.combine(f.opacity(t.color)?t.color:f.defaultLine,u),p=t.borderColor||f.contrast(h),g=C(t,F,i,a,L,e),v=g[0],m=g[1],y=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||_,t.fontColor||p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),A=0,M=0;if(m&&m!==v){w.call(c.font,t.fontFamily||x,t.fontSize||_,d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var E=w.node().getBoundingClientRect();A=E.width+2*T,M=E.height+2*T}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:p});var S,O,D=y.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,N=t.ya._offset+(t.y0+t.y1)/2,B=Math.abs(t.x1-t.x0),j=Math.abs(t.y1-t.y0),U=D.width+k+T+A;if(t.ty0=R-D.top,t.bx=D.width+2*T,t.by=Math.max(D.height+2*T,M),t.anchor="start",t.txwidth=D.width,t.tx2width=A,t.offset=0,s)t.pos=z,S=N+j/2+U<=P,O=N-j/2-U>=0,"top"!==t.idealAlign&&S||!O?S?(N+=j/2,t.anchor="start"):t.anchor="middle":(N-=j/2,t.anchor="end");else if(t.pos=N,S=z+B/2+U<=I,O=z-B/2-U>=0,"left"!==t.idealAlign&&S||!O)if(S)z+=B/2,t.anchor="start";else{t.anchor="middle";var V=U/2,H=z+V-I,G=z-V;H>0&&(z-=H),G<0&&(z+=-G)}else z-=B/2,t.anchor="end";y.attr("text-anchor",t.anchor),A&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+N+")"+(s?"rotate("+b+")":""))})),it}function C(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=I(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,f=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,f,u,h,t.trace._meta)).replace(E,(function(e,r){return s=I(r,t.nameLength),""}))),[l,s]}function L(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],u=s*(k+T),f=u+s*(t.txwidth+T),h=0,d=t.offset;"middle"===i&&(u-=t.tx2width/2,f+=t.txwidth/2+T),e&&(d*=-A,h=t.offset*w),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+h)+","+(k+d)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+h)+"V"+(d-k)+"Z");var p=u+h,g=d+t.ty0-t.by/2+T,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),p="middle"===i?-t.bx/2-t.tx2width/2+T:-t.bx-T):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),p="middle"===i?t.bx/2-t.tx2width/2-T:t.bx+T)),a.call(l.positionText,p,g),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*T+h,d+t.ty0-t.by/2+T),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,d-t.by/2-1,t.tx2width,t.by+2))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function D(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||h){var g=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,A=a.spikethickness,k=a.spikecolor||_,T=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var M=a._counterDomainMin,E=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),E=Math.max(E,a.position)),b=l.l+M*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:k,"stroke-dasharray":c.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?A:-A),cy:m,r:A,fill:k}).classed("spikeline",!0)}if(p){var S,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(S=u.pointerX,C=u.pointerY):(S=n._offset+L.x,C=a._offset+L.y);var O,D,R=i.readability(L.color,g)<1.5?f.contrast(g):L.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,z=d.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(O=z,D=C),-1!==I.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,D=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":c.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:z-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function R(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function I(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":458,"../../lib/events":450,"../../lib/override_cursor":469,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"../../registry":551,"../color":330,"../dragelement":349,"../drawing":352,"../legend/defaults":382,"../legend/draw":383,"./constants":364,"./helpers":366,d3:83,"fast-isnumeric":152,tinycolor2:284}],368:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":458,"../color":330,"./helpers":366}],369:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,s=i("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!d&&!p)"independent"===k("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===k("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",k,w,b,y),y:c("y",k,A,x,m,_)}}else delete e.grid}function k(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,b,x=_("orientation");"h"===x?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),_("traceorder",h),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",b),_("valign"),a.noneOrAll(u,v,["x","y"]),_("title.text")&&(_("title.side","h"===x?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":458,"../../plot_api/plot_template":495,"../../plots/layout_attributes":541,"../../registry":551,"./attributes":380,"./helpers":386}],383:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],s=i.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,p=r._maxNameLength;r.entries?n=i.text:(n=l?i.label:s.name,s._meta&&(n=a.templateString(n,s._meta)));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?A(n,p):n),f.positionText(g,d.textGap,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(T,t,e,r).on("edit",(function(n){this.text(A(n,p)).call(T,t,e,r);var s=i.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),f=u[u.length-1],h=a.keyedContainer(s,"transforms["+f+"].styles","target","value.name");h.set(i.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):T(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function T(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*g;if(i){var h=u.bBox(i);o=h.height,s=h.width,n?u.setTranslate(a,0,.25*o):u.setTranslate(a,l,.75*o+l)}else{var p=t.select(n?".legendtext":".legendtitletext"),v=f.lineCount(p),m=p.node();o=c*v,s=m?u.bBox(m).width:0;var y=c*((v-1)/2-.3);n?f.positionText(p,d.textGap,-y):f.positionText(p,d.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function E(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,f="legend"+s._uid;if(e?(r=e.layer,f+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;h=y(e.entries,e)}var p=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),A=a.ensureSingleById(s._topdefs,"clipPath",f,(function(t){t.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));S.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,L.font).text(L.text),T(O,C,t,e)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),R=C.selectAll("g.groups").data(h);R.enter().append("g").attr("class","groups"),R.exit().remove();var I=R.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){e._main&&n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.textGap,p=d.itemGap,g=2*(c+p),v=E(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+_[0],c+_[1]+a._height+e/2+p),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=h+a._width,a._width+=p+h+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),A=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,T=y||m,S=i.width/2;a._maxWidth=Math.max(A?T&&"left"===w?o.l+o.w:S:k?T&&"right"===w?o.r+o.w:S:o.w,2*h);var C=0,L=0;r.each((function(t){var e=t[0].width+h;C=Math.max(C,e),L+=e})),b=null;var O=0;if(l){var D=0,R=0,I=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,_[0],_[1]+c+p+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),D=Math.max(D,e);var r=t+p;r+c+R>a._maxWidth&&(O=Math.max(O,R),R=0,I+=D+a.tracegroupgap,D=e),u.setTranslate(this,R,I),R+=r})),a._width=Math.max(O,R)+c,a._height=I+D+g}else{var P=r.size(),F=L+f+(P-1)*pa._maxWidth&&(O=Math.max(O,j),N=0,B+=z,a._height+=z,z=0),u.setTranslate(this,_[0]+c+N,_[1]+c+B+e/2+p),j=N+r+p,N+=n,z=Math.max(z,e)})),F?(a._width=N+f,a._height=z+g):(a._width=Math.max(O,j)+f,a._height+=z+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var U=t._context.edits,V=U.legendText||U.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?h:b||h+t[0].width;s||(a+=p/2),u.setRect(e,0,-r/2,a,r)}))}(t,R,I,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=E(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var c,h,p,y,b=s._size,x=e.borderwidth,w=b.l+b.w*e.x-v[M(e)]*e._width,k=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var T=w,L=k;w=a.constrain(w,0,s.width-e._width),k=a.constrain(k,0,s.height-e._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),k!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(g,w,k),D.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var O=e._effHeight;e._main||(O=e._height),S.attr({width:e._width-x,height:O-x,x:x/2,y:x/2}),u.setTranslate(C,0,0),A.select("rect").attr({width:e._width-2*x,height:O-2*x,x:x,y:x}),u.setClipUrl(C,f,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var R,I,P,F=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),z=e._effHeight-F-2*d.scrollBarMargin,N=e._height-e._effHeight,B=z/N,j=Math.min(e._scrollY||0,N);S.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),A.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+j}),u.setClipUrl(C,f,t),H(j,F,B),g.on("wheel",(function(){H(j=a.constrain(e._scrollY+n.event.deltaY/z*N,0,N),F,B),0!==j&&j!==N&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;R="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,P=j})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(j=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));D.call(U);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(R=t.changedTouches[0].clientY,P=j)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,H(j=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));C.call(V)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=u.getTranslate(g);p=t.x,y=t.y},moveFn:function(t,r){var n=p+t,a=y+r;u.setTranslate(g,n,a),c=l.align(n,0,b.l,b.l+b.w,e.xanchor),h=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(C,0,-r),u.setRect(D,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),A.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":432,"../../lib":458,"../../lib/events":450,"../../lib/svg_text_utils":482,"../../plots/plots":543,"../../registry":551,"../color":330,"../dragelement":349,"../drawing":352,"./constants":381,"./get_legend_data":384,"./handle_click":385,"./helpers":386,"./style":388,d3:83}],384:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,u={},c=0,f=0,h=e._main;function d(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;a=e.width}return p?n:Math.min(a,r)};function v(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},u=r?i.visible&&i.type===r:a.traceIs(i,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],a=g(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function m(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,d=g(f(h.width,o.pts),h,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=h.color;var v=i.minExtend(o,{trace:p});c(u,v,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(0,"+u+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=a.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,u=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,f=n.select(this),d=l(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;c=0===u?p[g?v-1:0][1]:1===u?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[u]||m[0]:m}f.attr("d",t[0]),c?f.call(s.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;o.gradient(t,e,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,v(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){v(t,this,"funnel")})).each((function(t){v(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:p?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){m(t,this,"funnelarea")})).each((function(t){m(t,this,"pie")})).each((function(t){var r,a,s=t[0],c=s.trace,f=c.visible&&c.fill&&"none"!==c.fill,d=u.hasLines(c),p=c.contours,v=!1,m=!1,y=l(c),b=y.colorscale,x=y.reversescale;if(p){var _=p.coloring;"lines"===_?v=!0:d="none"===_||"heatmap"===_||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=u.hasMarkers(c)||u.hasText(c),A=f||m,k=d||v,T=w||!A?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),E=M.select(".legendfill").selectAll("path").data(f||m?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),b,"fill")}}),d||v){var S=g(void 0,c.line,10,5);a=i.minExtend(c,{line:{width:S}}),r=[i.minExtend(s,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(d||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",T+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),b,"stroke")}})})).each((function(t){var r,a,s=t[0],l=s.trace,c=u.hasMarkers(l),f=u.hasText(l),h=u.hasLines(l);function d(t,e,r,n){var a=i.nestedProperty(l,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(p&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||f||h){var v={},m={};if(c){v.mc=d("marker.color",g),v.mx=d("marker.symbol",g),v.mo=d("marker.opacity",i.mean,[.2,1]),v.mlc=d("marker.line.color",g),v.mlw=d("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=d("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}h&&(m.line={width:d("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=d("textposition",g),v.ts=10,v.tc=d("textfont.color",g),v.tf=d("textfont.family",g)),r=[i.minExtend(s,v)],(a=i.minExtend(l,m)).selectedpoints=null,a.texttemplate=null}var b=n.select(this).select("g.legendpoints"),x=b.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,a,e),c&&(r[0].mrc=3);var _=b.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":458,"../../registry":551,"../../traces/pie/helpers":606,"../../traces/pie/style_one":607,"../../traces/scatter/subtypes":637,"../color":330,"../colorscale/helpers":341,"../drawing":352,d3:83}],389:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):p?(E=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):d?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(E=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];h&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=f,S="y0",T=y,C="y1"):(k=y,S="y1",T=f,C="y0");W(n),J(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?Y:Z,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),Q(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;Q(s)}};function W(r){if(m(t))R=null;else if(F)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!z&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),R=l.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=G(A+a)):(l=function(t){return G(V(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else I?N("xanchor",r.xanchor=H(b+n)):(N("x0",r.x0=H(u+n)),N("x1",r.x1=H(v+n))),P?N("yanchor",r.yanchor=G(A+a)):(N("y0",r.y0=G(f+a)),N("y1",r.y1=G(y+a)));e.attr("d",_(t,r)),J(s,r)}function Z(n,a){if(z){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=G(A+a)):(l=function(t){return G(V(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var c=u+n,h=P?f-a:f+a;N("x0",r.x0=I?c:H(c)),N("y0",r.y0=P?h:G(h))}else if("resize-over-end-point"===R){var d=v+n,p=P?y-a:y+a;N("x1",r.x1=I?d:H(d)),N("y1",r.y1=P?p:G(p))}}else{var m=function(t){return-1!==R.indexOf(t)},x=m("n"),q=m("s"),X=m("w"),W=m("e"),Y=x?k+a:k,Z=q?T+a:T,Q=X?M+n:M,$=W?E+n:E;P&&(x&&(Y=k-a),q&&(Z=T-a)),(!P&&Z-Y>10||P&&Y-Z>10)&&(N(S,r[S]=P?Y:G(Y)),N(C,r[C]=P?Z:G(Z))),$-Q>10&&(N(L,r[L]=I?Q:H(Q)),N(O,r[O]=I?$:H($)))}e.attr("d",_(t,r)),J(s,r)}function J(t,e){(I||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=U(I?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=V(P?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function Q(t){t.selectAll(".visual-cue").remove()}h.init(X),q.node().onmousemove=W}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",O||u.opacity(E)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,v(t)}}(t,I)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),m=t._fullLayout._size;if(d?(r=g.shapePositionToRange(d),n=function(t){return d._offset+d.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=g.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===h)return d&&"date"===d.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,f=b-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,_=(c+f)/2,w=Math.abs(x-l),A=Math.abs(_-c),k="A"+w+","+A,T=x+w+","+_;return"M"+T+k+" 0 1,1 "+(x+","+(_-A))+k+" 0 0,1 "+T+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),T&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===A&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function D(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,a=s.ensureSingle(t,"rect",c.railRectClass);a.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+c.groupClassName).data(r,v);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||f<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform","translate("+v+")")}}}return I.call(P),D&&(E?I.on(".opacity",null):(k=0,T=!0,I.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),I.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(P)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),I.classed("js-placeholder",T),w}}},{"../../constants/alignment":432,"../../constants/interactions":435,"../../lib":458,"../../lib/svg_text_utils":482,"../../plots/plots":543,"../../registry":551,"../color":330,"../drawing":352,d3:83,"fast-isnumeric":152}],426:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":451,"../../plot_api/edit_types":488,"../../plot_api/plot_template":495,"../../plots/font_attributes":533,"../../plots/pad_attributes":542,"../color/attributes":329}],427:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],428:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":458,"../../plots/array_container_defaults":501,"./attributes":426,"./constants":427}],429:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(M,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(E,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(A,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(A,o),c.call(_,o)}))})),c.call(_,o),b?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,T=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,E=p,S=v+m;S+M>u&&(S=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:T,height:M}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=m>A,O=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+O>l&&(R=l-O);var P=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:O,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,z=c-.5,N=L?f+O+.5:f+.5,B=h-.5,j=k?d+M+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(k||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||L?(this._clipRect=U.select("rect").attr({x:Math.floor(z),y:Math.floor(B),width:Math.ceil(N)-Math.floor(z),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||L){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(H),L&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":458,"../color":330,"../drawing":352,d3:83}],432:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],433:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],434:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],435:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],436:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],437:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],438:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],441:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],442:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":465}],443:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||u(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var k=A[1],T=A[3]||"1",M=Number(A[5]||1),E=Number(A[7]||0),S=Number(A[9]||0),C=Number(A[11]||0);if(u){if(2===k.length)return c;var L;k=Number(k);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),L=O.newDate(k,O.toMonthIndex(k,T,D),M)}else L=O.newDate(k,Number(T),M)}catch(t){return c}return L?(L.toJD()-g)*f+E*h+S*d+C*p:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var R=new Date(Date.UTC(2e3,T,M,E,S));return R.setUTCFullYear(k),R.getUTCMonth()!==T||R.getUTCDate()!==M?c:R.getTime()+C*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,k=3*h,T=5*d;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var L=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+L);return u.setUTCMonth(u.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":465}],455:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;xo?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(a||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var a;return C.test(n)?a=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,a=r[n]()),l.isValidTextValue(a)?a:""}))};var L={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return R.apply(L,arguments)};var O={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return R.apply(O,arguments)};var D=/^[:|\|]/;function R(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,f,h,d;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var I=2e9;l.seedPseudoRandom=function(){I=2e9},l.pseudoRandom=function(){var t=I;return I=(69069*I+1)%4294967296,Math.abs(I-t)<429496729?l.pseudoRandom():I/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(a-u*(r+o))+","+(i-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":436,"./anchor_utils":441,"./angles":442,"./array":443,"./clean_number":444,"./clear_responsive":446,"./coerce":447,"./dates":448,"./dom":449,"./extend":451,"./filter_unique":452,"./filter_visible":453,"./geometry2d":454,"./identity":457,"./is_plain_object":459,"./keyed_container":460,"./localize":461,"./loggers":462,"./make_trace_groups":463,"./matrix":464,"./mod":465,"./nested_property":466,"./noop":467,"./notifier":468,"./push_unique":472,"./regex":474,"./relative_attr":475,"./relink_private":476,"./search":477,"./stats":480,"./throttle":483,"./to_log_range":484,d3:83,"fast-isnumeric":152}],459:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],460:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":493,"./notifier":468}],463:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:83}],464:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],466:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":436,"./matrix":464}],471:[function(t,e,r){(function(r){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":479,regl:259}],472:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":443,"fast-isnumeric":152}],481:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":61}],482:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,T){var M=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void e();var l=C.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:L,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||s(t,"height"))/4;"y"===L[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?o.attr({x:t.attr("x"),y:p-h/2}):"a"===L[0]&&0!==L.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-h/2}),T&&T.call(t,l),e(l)}))}))):O(),t}function O(){C.empty()||(L=t.attr("class")+"-math",C.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}y.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(v),L=0;L|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(v),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):T[e])||t}))}function S(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="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:a()-u.top+"px",left:i()-u.left+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(v),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],484:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":152}],485:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],486:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],487:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,k,T,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=c(m,f).get(),O=[],D=-1,R=C.length;for(b=0;bC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==k)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?O.push(_):T?("add"===k&&(k={}),C.splice(_,0,k),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===D&&(D=_);else for(x=0;x=0;b--)C.splice(O[b],1),L&&L.splice(O[b],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(h(v,m),p!==a){var I;if(-1===D)I=E;else{for(R=Math.max(C.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(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]),R(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&R(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in R(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=D(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function H(t,e,r){if(t=o.getGraphDiv(t),A.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Z(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(G(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(k.doLegend),i.layoutstyle&&s.push(k.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(k.doTicksRelayout),i.modebar&&s.push(k.doModeBar),i.camera&&s.push(k.doCamera),i.colorbars&&s.push(k.doColorBars),s.push(S)),s.push(h.rehover,h.redrag),u.add(t,H,[t,a.undoit],H,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function G(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=p.getFromId(t,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=B(l._preGUI,u),d=Object.keys(e),g=p.list(t),v=o.extendDeepAll({},e),m={};for(V(e),d=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var F=R.parts[P],z=R.parts[P-1]+"."+F,j=R.parts.slice(0,P).join("."),U=s(t.layout,j).get(),H=s(l,j).get(),G=R.get();if(void 0!==I){k[D]=I,E[D]="reverse"===F?I:N(G);var q=f.getLayoutValObject(l,R.parts);if(q&&q.impliedEdits&&null!==I)for(var Z in q.impliedEdits)S(o.relativeAttr(D,Z),q.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(I){S("autosize",null);var Q="height"===D?"width":"height";S(Q,l[Q])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",I?null:l.width),S("height",I?null:l.height);else if(z.match(X))O(z),s(l,j+"._inputRange").set(null);else if(z.match(W)){O(z),s(l,j+"._inputRange").set(null);var $=s(l,j).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else z.match(Y)&&s(l,j+"._inputDomain").set(null);if("type"===F){var K=U,tt="linear"===H.type&&"log"===I,et="log"===H.type&&"linear"===I;if(tt||et){if(K&&K.range)if(H.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&S(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(j+".range[0]",Math.log(rt)/Math.LN10),S(j+".range[1]",Math.log(nt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,rt)),S(j+".range[1]",Math.pow(10,nt)))}else S(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,I,S),c.getComponentMethod("images","convertCoords")(t,H,I,S)}else S(j+".autorange",!0),S(j+".range",null);s(l,j+"._inputRange").set(null)}else if(F.match(M)){var at=s(l,D).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,at,it,S),c.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(D);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=q||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(I)?E[D]=null:w.isRemoveVal(I)?E[D]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,lt),m[r]||(m[r]={});var ut=m[r][n];ut||(ut=m[r][n]={}),ut[st]=I,delete e[D]}else"reverse"===F?(U.range?U.range.reverse():(S(j+".autorange",!0),U.range=[1,0]),H.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==G&&"select"!==G||l._has("gl2d")?_.plot=!0:q?T.update(_,q):_.calc=!0,R.set(I))}}for(r in m){w.applyContainerArrayChanges(t,h(i,r),m[r],_,h)||(_.plot=!0)}var ct=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,A.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&kk)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&E<5&&(E++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===E&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=i[o])}return x(a,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":458,"../plots/attributes":502}],496:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=A(c,k,c.side),c._mainMirrorPosition=c.mirror&&k?A(c,k,d.OPPOSITE_SIDE[c.side]):null}var T=[],M=[],E=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,L=s.yaxis.domain,O=s.plotgroup;if(y(C,L,E)){var D=O.node(),R=s.bg=o.ensureSingle(O,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),M.push(a)}else O.select("rect.bg").remove(),E.push([C,L]),S||(T.push(a),M.push(a))}var I,P,F,z,N,B,j,U,V,H,G,q,X,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":458,"../plots/attributes":502,"../plots/plots":543,"./plot_config":493,"./plot_schema":494,"./plot_template":495}],498:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var M=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(k);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var d=i.graphJson(k,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,T,M).then(E).then(S).then(C).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":458,"../plots/plots":543,"../snapshot/helpers":555,"../snapshot/svgtoimg":557,"../snapshot/tosvg":559,"../version":665,"./plot_api":492,"fast-isnumeric":152}],499:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var T,M,E,S,C,L=b.length,O=Array.isArray(k);if(O&&(L=Math.min(L,k.length)),2===x.dimensions)for(M=0;Mb[M].length&&a.push(p("unused",i,m.concat(M,b[M].length)));var D=b[M].length;for(T=0;T<(O?Math.min(D,k[M].length):D);T++)E=O?k[M][T]:k,S=y[M][T],C=b[M][T],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(M,T),S,C)):a.push(p("value",i,m.concat(M,T),S))}else a.push(p("array",i,m.concat(M),y[M]));else for(M=0;M1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((x=T-o(v)-o(m))>M?_/x>S&&(y=v,b=m,S=_/x):_/T>S&&(y={val:v.val,pad:0},b={val:m.val,pad:0},S=_/T));if(h===d){var C=h-1,L=h+1;if(A)if(0===h)i=[0,1];else{var O=(h>0?f:c).reduce((function(t,e){return Math.max(t,o(e))}),0),D=h/(1-Math.min(.5,O/T));i=h>0?[0,D]:[D,0]}else i=k?[Math.max(0,C),Math.max(1,L)]:[C,L]}else A?(y.val>=0&&(y={val:0,pad:0}),b.val<=0&&(b={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),b.val<=0&&(b={val:1,pad:0})),S=(b.val-y.val-E(v.val,m.val))/(T-o(y)-o(b)),i=[y.val-S*o(y),b.val+S*o(b)];return p&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function d(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,s,l,u,h,p,g,v,m=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,A=!1,k=r.vpadLinearized||!1;function T(t){if(Array.isArray(t))return A=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!A){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":436,"../../lib":458,"../../registry":551,"fast-isnumeric":152}],505:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),p=t("../../constants/numerical"),g=p.ONEAVGYEAR,v=p.ONEAVGMONTH,m=p.ONEDAY,y=p.ONEHOUR,b=p.ONEMIN,x=p.ONESEC,_=p.MINUS_SIGN,w=p.BADNUM,A=t("../../constants/alignment"),k=A.MID_SHIFT,T=A.CAP_SHIFT,M=A.LINE_SPACING,E=A.OPPOSITE_SIDE,S=e.exports={};S.setConvert=t("./set_convert");var C=t("./axis_autotype"),L=t("./axis_ids");S.id2name=L.id2name,S.name2id=L.name2id,S.cleanId=L.cleanId,S.list=L.list,S.listIds=L.listIds,S.getFromId=L.getFromId,S.getFromTrace=L.getFromTrace;var O=t("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes;function D(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}S.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||i),i||(i=a),c[u]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,c,u)},S.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var u=S.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},S.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:S.getFromId(e,r).cleanPos)(t)},S.redrawComponents=function(t,e){e=e||S.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},S.saveRangeInitial=function(t,e){for(var r=S.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=S.tickIncrement(t,"M6","reverse")+1.5*m:i.exactMonths>.8?t=S.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=S.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,y,u,i)),v=b,0;v<=c;)v=S.tickIncrement(v,y,!1,i);return{start:e.c2r(b,0,i),end:e.c2r(v,0,i),size:y,_dataSpan:c-u}},S.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/a,S.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),G(t)},S.calcTicks=function(t,e){S.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=D(s.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ci&&f=o:n<=o)&&!(u.length>r||n===e);n=S.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var a=!1;c&&n!==(0|n)&&(a=!0),u.push({minor:a,value:n})}}(),t.rangebreaks){var f=u.length;if(f){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var d,p=[],g=l?1:-1,v=l?f-1:0,m=l?0:f-1;g*m<=g*v;m+=g){var y=u[m];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var b=t.c2p(y.value);b===d?p[p.length-1].valueh)&&(d=b,p.push(y))}}u=p.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&i<=10||e>=15*m)t._tickround="d";else if(e>=b&&i<=16||e>=y)t._tickround="M";else if(e>=x&&i<=19||e>=b)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(W(t.exponentformat)&&!Y(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function q(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*H(e,r,F)):i>v?(e/=v,t.dtick="M"+H(e,1,z)):i>m?(t.dtick=H(e,m,t._hasDayOfWeekBreaks?[1,2,7,14]:B),t.tick0=s.dateTick0(t.calendar,!0)):i>y?t.dtick=H(e,y,z):i>b?t.dtick=H(e,b,N):i>x?t.dtick=H(e,x,N):(r=n(10),t.dtick=H(e,r,F))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+H(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=H(e,r,V)):(t.tick0=0,r=n(10),t.dtick=H(e,r,F));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},S.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?U:j,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},S.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Z(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||W(d)&&Y(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":_)+h:(e.text=Z(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=Z(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=Z(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=Z(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},S.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return S.hoverLabelText(t,e)+" - "+S.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=S.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var X=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Y(t){return t>14||t<-15}function Z(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=S.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};G(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":W(l)&&(t+=X[u/3+5]));return i?_+t:t}function J(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,f),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==h._dfltTitle[p]&&(n[l]+=$(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[u]+=f),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Y&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,et(e),n),i.autoMargin(t,rt(e),a),i.autoMargin(t,nt(e),s)})),r.skipTitle||Y&&"bottom"===e.side||X.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+$(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,d=S.getPxPosition(t,e);"x"===i?(l=e._offset+e._length/2,c="top"===e.side?d-r:d+r):(c=e._offset+e._length/2,l="right"===e.side?d+r:d-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(h={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var g=f.getTranslate(p.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(X)}}function Z(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=tt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},S.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},S.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},S.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},S.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,d,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(d="bottom"===t.side?1:-1,c=l*d,f=e+o*d,h="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+f+t.fontSize*h},p.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*d<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(d="right"===t.side?1:-1,c=o,f=-l*d,h=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*d},p.yFn=function(t){return t.dy+f+t.fontSize*k},p.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},S.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],Q);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&S.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*b)||A)for(r=0;rR&&FO&&(O=F);d/=(O-L)/(2*D),L=u.l2r(L),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function z(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function B(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,a,i)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function U(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){L&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),L=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function G(t,e,r,n){for(var a,i,o,l,u=!1,c={},f={},h=0;h=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(U(a),2!==t||pt||Ut(),dt)i.indexOf("select")>-1&&T(r,a,Z,J,e.id,St),i.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&&pt){var s=g?j:O,u="s"===g||"w"===L?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,u),d="left",p="middle";if(s.fixedrange)return;g?(p="n"===g?"top":"bottom","right"===s.side&&(d="right")):"e"===L&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(mt).call(l.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:p}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",a,c,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,e+yt)),a=Math.max(0,Math.min(tt,r+bt)),i=Math.abs(n-yt),o=Math.abs(a-bt);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Mt.attr("d","M0,0Z")}if(xt.l=Math.min(yt,n),xt.r=Math.max(yt,n),xt.t=Math.min(bt,a),xt.b=Math.max(bt,a),et.isSubplotConstrained)i>C||o>C?(kt="xy",i/K>o/tt?(o=i*tt/K,bt>a?xt.t=bt-o:xt.b=bt+o):(i=o*K/tt,yt>n?xt.l=yt-i:xt.r=yt+i),Mt.attr("d",H(xt))):s();else if(rt.isSubplotConstrained)if(i>C||o>C){kt="xy";var l=Math.min(xt.l/K,(tt-xt.b)/tt),u=Math.max(xt.r/K,(tt-xt.t)/tt);xt.l=l*K,xt.r=u*K,xt.b=(1-l)*tt,xt.t=(1-u)*tt,Mt.attr("d",H(xt))}else s();else!at||og[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":458,"fast-isnumeric":152}],523:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":432}],524:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),A=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),T=k.MINSELECT,M=b.filter,E=b.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),L=C.p2r,O=C.axValue,D=C.getTransform;function R(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){z(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!j){var r=Y.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&R(e,W,a.xaxes,a.yaxes,a.subplot,a,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},a.doneFn=function(){ft.remove(),x.done(ht).then((function(){x.clear(ht),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=st,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,b)),a.doneFnCompleted&&a.doneFnCompleted(dt)})).catch(y.error),j&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:R}},{"../../components/color":330,"../../components/dragelement/helpers":348,"../../components/drawing":352,"../../components/fx":370,"../../components/fx/helpers":366,"../../components/shapes/draw_newshape/display_outlines":415,"../../components/shapes/draw_newshape/helpers":416,"../../components/shapes/draw_newshape/newshapes":417,"../../lib":458,"../../lib/clear_gl_canvases":445,"../../lib/polygon":470,"../../lib/throttle":483,"../../plot_api/subroutines":496,"../../registry":551,"./axis_ids":508,"./constants":511,"./handle_outline":515,"./helpers":516,polybooljs:241}],525:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,u=i.ensureNumber,c=i.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,b=t("./axis_ids"),x=t("./constants"),_=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function T(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*p*Math.abs(n-a))}return d}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===d){if(!a(e))return d;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function E(e,r,n){return s(e,r,n||t.calendar)}function S(e){return t._categories[Math.round(e)]}function C(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function L(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=L(t);return void 0!==e?e:a(t)?+t:void 0}function D(t,e,r){return n.round(r+e*t,2)}function R(t,e,r){return(t-r)/e}var I=function(e){return a(e)?D(e,t._m,t._b):d},P=function(e){return R(e,t._m,t._b)};if(t.rangebreaks){var F="y"===f;I=function(e){if(!a(e))return d;var r=t._rangebreaks.length;if(!r)return D(e,t._m,t._b);var n=F;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var f=t._B[s]||0;return isFinite(f)?D(e,t._m2,f):0},P=function(e){var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return R(e,t._m2,t._B[n])}}t.c2l="log"===t.type?T:u,t.l2c="log"===t.type?A:u,t.l2p=I,t.p2l=P,t.c2p="log"===t.type?function(t,e){return I(T(t,e))}:I,t.p2c="log"===t.type?function(t){return A(P(t))}:P,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=P,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return T(o(t),e)},t.r2d=t.r2c=function(t){return A(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=T,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(P(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=P,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=E,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return E(P(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=C,t.r2d=t.c2d=t.l2d=S,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return S(P(t))},t.r2p=t.d2p,t.p2r=P,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=S,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=L,t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return S(P(t))},t.r2p=t.d2p,t.p2r=P,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;ah&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=b.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),h="y"===f;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;sa&&(a+=7,sa&&(a+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,A=h?c/d[3]:1,k=f?d[0]:0,T=h?d[1]:0,M=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,S=a._offset-M,C=l._offset-E;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":352,"../../lib":458,"../../registry":551,"./axes":505,d3:83}],530:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(v(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i1&&R.length>1){for(i.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(f,s,c,a),y.cleanPlot(f,s,c,a);var N=!(!a._has||!a._has("gl2d")),B=!(!s._has||!s._has("gl2d")),j=!(!a._has||!a._has("cartesian"))||N,U=!(!s._has||!s._has("cartesian"))||B;j&&!U?a._bgLayer.remove():U&&!j&&(s._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&h({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=y.layoutAttributes.width.min,d=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,u=i.componentsRegistry,c=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in u)(s=u[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:f,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),E(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,d=e.height,p=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in p)g[v]||delete p[v];for(var m in p.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},p){var b=p[m].l||{},x=p[m].b||{},_=b.val,w=b.size,A=x.val,k=x.size;for(var T in p){if(a(w)&&p[T].r){var M=p[T].r.val,S=p[T].r.size;if(M>_){var C=(w*M+(S-h)*_)/(M-_),L=(S*(1-_)+(w-h)*(1-M))/(M-_);C>=0&&L>=0&&h-(C+L)>0&&C+L>s+u&&(s=C,u=L)}}if(a(k)&&p[T].t){var O=p[T].t.val,D=p[T].t.size;if(O>A){var R=(k*O+(D-d)*A)/(O-A),I=(D*(1-A)+(k-d)*(1-O))/(O-A);R>=0&&I>=0&&d-(I+R)>0&&R+I>f+c&&(f=R,c=I)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(d)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var P=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(f.layout=c(s)),t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),u&&(f.frames=c(u)),i&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:c,y:c}]),i[0].t||(i[0].t={}),i[0].trace=r,p[e]=i}}for(O(u,h,d),a=0;a=0?h.angularAxis.domain:n.extent(A),S=Math.abs(A[1]-A[0]);T&&!k&&(S=0);var C=E.slice();M&&k&&(C[1]+=S);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=h.angularAxis.ticksStep||(C[1]-C[0])/(L*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var R=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));t=n.select(I)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var P,F=t.select(".chart-group"),z={fill:"none",stroke:h.tickColor},N={"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){P=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var B=d.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:d.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:P,elements:B,reverseOrder:h.legend.reverseOrder})})();var j=P.node().getBBox();b=Math.min(h.width-j.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],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),P.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else P=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(j?j.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(N).text(h.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var G=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var q=G.selectAll("circle.grid-circle").data(r.ticks(5));q.enter().append("circle").attr({class:"grid-circle"}).style(z),q.attr("r",r),q.exit().remove()}G.select("circle.outside-circle").attr({r:b}).style(z);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),G.selectAll(".domain").style(z),G.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(N).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,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),J.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(z),J.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(N);var Q=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:i+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,a=h.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(N);h.angularAxis.rewriteTicks&&Q.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(F.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));P.attr({transform:"translate("+[b+$,h.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||K){var et=[];d.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(X).radius);var a=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,a,i)},"stroke-width":function(t,e){return p["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,a,i)},opacity:function(t,e){return p.opacity(r,a,i)},display:function(t,e){return p.display(r,a,i)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=u),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var h=i.padding,d=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[i.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*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":432,"../../../lib":458,d3:83}],548:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,a,i,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return a.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},h.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.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:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":330,"../../../lib":458,"./micropolar":547,"./undo_manager":549,d3:83}],549:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":330,"../components/drawing":352,"../constants/xmlns_namespaces":437,"../lib":458,d3:83}],560:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===v?h=g.showlines=!0:(h=r("contours.showlines"),p=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(d=r("line.color",p&&s(p)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,d,f)}},{"../../components/color":330,"../../constants/filter_ops":434,"./label_defaults":568,"fast-isnumeric":152}],565:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],566:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./constraint_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,a){return n.coerce(t,e,l,r,a)}if(a(t,e,c,u)){c("text"),c("hovertext"),c("hovertemplate"),c("hoverongaps");var f="constraint"===c("contours.type");c("connectgaps",n.isArray1D(e.z)),f?i(t,e,c,u,r):(o(t,e,c,(function(r){return n.coerce2(t,e,l,r)})),s(t,e,c,u))}else e.visible=!1}},{"../../lib":458,"../heatmap/xyz_defaults":584,"./attributes":561,"./constraint_defaults":564,"./contours_defaults":565,"./style_defaults":571}],567:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],568:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":458}],569:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1,c=a.extractOpts(t);isFinite(s)||(s=1,l=1);var f,h,d=c.reversescale?a.flipScale(c.colorscale):c.colorscale,p=d.length,g=new Array(p),v=new Array(p);if("heatmap"===e.coloring){var m=c.min,y=c.max;for(h=0;hr.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,h=t._input.contours;if(c>f&&(r.start=h.start=f,f=r.end=h.end=c,c=r.start),!(r.size>0))u=c===f?1:i(c,f,t.ncontours).dtick,h.size=r.size=u}}},{"../../lib":458,"../../plots/cartesian/axes":505}],571:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,u,o)}},{"../../components/colorscale/defaults":340,"./label_defaults":568}],572:[function(t,e,r){"use strict";var n=t("gl-contour2d"),a=t("gl-heatmap2d"),i=t("../../plots/cartesian/axes"),o=t("../contour/make_color_map"),s=t("../../lib/str2rgbarray");function l(t,e){this.scene=t,this.uid=e,this.type="contourgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.contourOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],levels:[0],levelColors:[0,0,0,1],lineWidth:1},this.contour=n(t.glplot,this.contourOptions),this.contour._trace=this,this.heatmapOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,0]},this.heatmap=a(t.glplot,this.heatmapOptions),this.heatmap._trace=this}var u=l.prototype;function c(t,e){for(var r=t.contours,n=r.start,a=r.end,i=r.size||1,l=e.fill,u=o(t),c=Math.floor((a-n)/i)+(l?2:1),f=new Array(c),h=new Array(4*c),d=0;dD){L("x scale is not linear");break}}if(m.length&&"fast"===S){var R=(m[m.length-1]-m[0])/(m.length-1),I=Math.abs(R/100);for(_=0;_I){L("y scale is not linear");break}}}var P=a.maxRowLength(x),F="scaled"===e.xtype?"":r,z=h(e,F,g,v,P,A),N="scaled"===e.ytype?"":m,B=h(e,N,y,b,x.length,k);E||(e._extremes[A._id]=i.findExtremes(A,z),e._extremes[k._id]=i.findExtremes(k,B));var j={x:z,y:B,z:x,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(F&&F.length===z.length-1&&(j.xCenter=F),N&&N.length===B.length-1&&(j.yCenter=N),M&&(j.xRanges=w.xRanges,j.yRanges=w.yRanges,j.pts=w.pts),T||s(t,e,{vals:x,cLetter:"z"}),T&&e.contours&&"heatmap"===e.contours.coloring){var U={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=h(U,F,g,v,P,A),j.yfill=h(U,N,y,b,x.length,k)}return[j]}},{"../../components/colorscale/calc":338,"../../constants/numerical":436,"../../lib":458,"../../plots/cartesian/axes":505,"../../registry":551,"../histogram2d/calc":593,"./clean_2d_array":576,"./convert_column_xyz":578,"./find_empties":580,"./interp2d":581,"./make_bound_array":582}],576:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":458}],581:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":458}],582:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,i),f(g+h,g+d,n,i)),m=Math.min(f(p+u,p+h,n,i),f(g+u,g+h,n,i));if(v>m&&mo){var y=s===a?1:6,b=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(ur.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),z||a.nestedProperty(e,m+".start").set(I.start)}var U=x.end,V=r.r2l(R.end),H=void 0!==V;if((x.endFound||H)&&V!==r.r2l(U)){var G=H?V:a.aggNums(Math.max,null,p);I.end=r.l2r(G),H||a.nestedProperty(e,m+".start").set(I.end)}var q="autobin"+s;return!1===e._input[q]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[q],delete e[q]),[I,p]}e.exports={calc:function(t,e){var r,i,d,p,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",b={x:"y",y:"x"}[y],x=e[y+"calendar"],_=e.cumulative,w=h(t,e,m,y),A=w[0],k=w[1],T="string"==typeof A.size,M=[],E=T?M:A,S=[],C=[],L=[],O=0,D=e.histnorm,R=e.histfunc,I=-1!==D.indexOf("density");_.enabled&&I&&(D=D.replace(/ ?density$/,""),I=!1);var P,F="max"===R||"min"===R?null:0,z=l.count,N=u[D],B=!1,j=function(t){return m.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[b])&&"count"!==R&&(P=e[b],B="avg"===R,z=l[R]),r=j(A.start),d=j(A.end)+(r-o.tickIncrement(r,A.size,!1,x))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var J=Math.min(g.length,v.length),Q=[],$=0,K=J-1;for(r=0;r=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=L[r],q?tt.ph0=tt.ph1=L[r].length?k[L[r][0]]:g[r]:(e._computePh=!0,tt.ph0=H(M[r]),tt.ph1=H(M[r+1],!0))),Q.push(tt)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,A.size,!1,x)-Q[0].p),s(Q,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Q,e,Y),Q},calcAllAutoBins:h}},{"../../lib":458,"../../plots/cartesian/axes":505,"../../registry":551,"../bar/arrays_to_calcdata":560,"./average":588,"./bin_functions":589,"./bin_label_vals":590,"./norm_functions":592,"fast-isnumeric":152}],592:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aE&&A.splice(E,A.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,D="string"==typeof T.size,R=[],I=[],P=O?R:w,F=D?I:T,z=0,N=[],B=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,G=i.count,q=o[j],X=!1,W=[],Y=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(X="avg"===U,G=i[U]);var J=w.size,Q=b(w.start),$=b(w.end)+(Q-a.tickIncrement(Q,J,!1,m))/1e6;for(r=Q;r<$;r=a.tickIncrement(r,J,!1,m))C.push(H),R.push(r),X&&L.push(0);R.push(r);var K,tt=C.length,et=(r-Q)/tt,rt=(K=Q+et/2,g.c2r(K,0,m)),nt=T.size,at=x(T.start),it=x(T.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],c=l,h=i;a*he){h=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[i],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var m=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function _(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),b(t.parentNode)}function w(t,e){var r=x(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function A(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||m()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=x(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){_(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),_(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,m(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&T(r)):T(r),i.brushCallback(e),b(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||T(r),i.brushCallback(e),u?b(t.parentNode,s):(s(),b(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function T(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(d).call(p).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(A).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(y);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?M(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":458,"../../lib/gup":456,"./constants":598,d3:83}],596:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":437,"../../plots/get_data":535,"./plot":605,d3:83}],597:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",m),n.coerceFont(c,"tickfont",m),n.coerceFont(c,"rangefont",m),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"../../lib":458,"../../plots/array_container_defaults":501,"../../plots/cartesian/axes":505,"../../plots/domain":532,"./attributes":594,"./axisbrush":595,"./constants":598,"./merge_length":603}],600:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":458}],601:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":594,"./base_plot":596,"./calc":597,"./defaults":599,"./plot":605}],602:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;ic&&(c=t[a].dim1.canvasX,o=a);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(E=E.slice(0,a._length));var S,C=a.tickvals;function L(t,e){return{val:t,text:S[e]}}function O(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){S=a.ticktext,Array.isArray(S)&&S.length?S.length>C.length?S=S.slice(0,C.length):C.length>S.length&&(C=C.slice(0,S.length)):S=C.map(n.format(a.tickformat));for(var D=1;D=r||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==I&&(c?a.hover(h):a.unhover&&a.unhover(h),I=f)}})),R.style("opacity",(function(t){return t.pick?0:1})),c.style("background","rgba(255, 255, 255, 0)");var P=c.selectAll("."+g.cn.parcoords).data(k,f);P.exit().remove(),P.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),P.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var F=P.selectAll("."+g.cn.parcoordsControlView).data(h,f);F.enter().append("g").classed(g.cn.parcoordsControlView,!0),F.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var z=F.selectAll("."+g.cn.yAxis).data((function(t){return t.dimensions}),f);z.enter().append("g").classed(g.cn.yAxis,!0),F.each((function(t){L(z,t)})),R.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=m(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),z.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),z.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;A.linePickActive(!1),t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,z.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),L(z,e),z.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),z.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!T(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,L(z,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!T(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),z.exit().remove();var N=z.selectAll("."+g.cn.axisOverlays).data(h,f);N.enter().append("g").classed(g.cn.axisOverlays,!0),N.selectAll("."+g.cn.axis).remove();var B=N.selectAll("."+g.cn.axis).data(h,f);B.enter().append("g").classed(g.cn.axis,!0),B.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return p.isOrdinal(t)?e:O(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(B.selectAll("text"),t.model.tickFont)})),B.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),B.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=N.selectAll("."+g.cn.axisHeading).data(h,f);j.enter().append("g").classed(g.cn.axisHeading,!0);var U=j.selectAll("."+g.cn.axisTitle).data(h,f);U.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),U.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=C(t.model.labelAngle,t.model.labelSide),r=g.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=C(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var V=N.selectAll("."+g.cn.axisExtent).data(h,f);V.enter().append("g").classed(g.cn.axisExtent,!0);var H=V.selectAll("."+g.cn.axisExtentTop).data(h,f);H.enter().append("g").classed(g.cn.axisExtentTop,!0),H.attr("transform","translate(0,"+-g.axisExtentOffset+")");var G=H.selectAll("."+g.cn.axisExtentTopText).data(h,f);G.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(S),G.text((function(t){return D(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var q=V.selectAll("."+g.cn.axisExtentBottom).data(h,f);q.enter().append("g").classed(g.cn.axisExtentBottom,!0),q.attr("transform",(function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"}));var X=q.selectAll("."+g.cn.axisExtentBottomText).data(h,f);X.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(S),X.text((function(t){return D(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),v.ensureAxisBrush(N)}},{"../../components/colorscale":342,"../../components/drawing":352,"../../lib":458,"../../lib/gup":456,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"./axisbrush":595,"./constants":598,"./helpers":600,"./lines":602,"color-rgba":63,d3:83}],605:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===f[s]){var h=i.constraintrange;f[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":471,"./helpers":600,"./parcoords":604}],606:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),v=a(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=u.length<100||c.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=i(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":481,"../../plots/cartesian/autorange":504,"../scatter/get_trace_color":623,"gl-pointcloud2d":176}],610:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":458,"./attributes":608}],611:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":538,"../scatter3d/calc":640,"./attributes":608,"./convert":609,"./defaults":610}],612:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rs&&T[v].gap;)v--;for(y=T[v].s,p=T.length-1;p>v;p--)T[p].s=y;for(;sM[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],620:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=u(t,e,g,v),b=!y&&mq!=(z=D[L][1])>=q&&(I=D[L-1][0],P=D[L][0],z-F&&(R=I+(P-I)*(q-F)/(z-F),U=Math.min(U,R),V=Math.max(V,R)));U=Math.max(U,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:q,y1:q,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":330,"../../components/fx":370,"../../lib":458,"../../registry":551,"./get_trace_color":623}],625:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":518,"./arrays_to_calcdata":612,"./attributes":613,"./calc":614,"./cross_trace_calc":618,"./cross_trace_defaults":619,"./defaults":620,"./format_labels":622,"./hover":624,"./marker_colorbar":631,"./plot":633,"./select":634,"./style":636,"./subtypes":637}],626:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"../../lib":458}],627:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,A,k,T,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,D=S._length,R=e.connectGaps,I=e.baseTolerance,P=e.shape,F="linear"===P,z=e.fill&&"none"!==e.fill,N=[],B=f.minTolerance,j=t.length,U=new Array(j),V=0;function H(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;L&&l===a&&(i*=Math.abs(E._m*D*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function G(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,J]),ut(t),Q=null,Z=J=0}function ft(t){if(T=t[0]/O,M=t[1]/D,W=t[0]rt?rt:0,Y=t[1]at?at:0,W||Y){if(V)if(Q){var e=K(Q,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else $=K(U[V-1],t)[0],U[V++]=$;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?(Q&&(Z!==W&&J!==Y?ut(Z&&J?(n=Q,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||Y]):Z&&J&&ut([Z,J])),ut([W,Y])):Z-W&&J-Y&&ut([W||Z,Y||J]),Q=t,Z=W,J=Y}else Q&&ct(K(Q,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===P||"spline"===P?K=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)q(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}Q&&ut([Z||Q[0],J||Q[1]]),N.push(U.slice(0,V))}return N}},{"../../constants/numerical":436,"../../lib":458,"./constants":617}],628:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],629:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(e,a):0}}},{"fast-isnumeric":152}],631:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],632:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":330,"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"./subtypes":637}],633:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),k=o(A,"g","errorbars"),T=o(A,"g","lines"),M=o(A,"g","points"),E=o(A,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var S,C;y(A).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var O,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var F,z,N,B,j,U,V,H="",G="",q=[],X=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),z=l.steps(w.shape.split("").reverse().join(""))):F=z="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return z(t.reverse())},q=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),l.singleLineStyle(f,a)}}}}}var W=T.selectAll(".js-line").data(q);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),q.length?(S?(S.datum(f),B&&U&&(L?("y"===L?B[1]=U[1]=x.c2p(0,!0):"x"===L&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&R?("tonext"===_.fill?y(C).attr("d",H+"Z"+R+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+R.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(I)):(Z(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=V):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(p=v),h&&(g=v)}var A,k=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&k.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function Q(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":352,"../../lib":458,"../../lib/polygon":470,"../../registry":551,"./line_points":627,"./link_traces":629,"./subtypes":637,d3:83}],634:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=g,A=2*_,k={},T=e._x=y.makeCalcdata(e,"x"),M=e._y=b.makeCalcdata(e,"y"),E=new Array(A);for(r=0;r<_;r++)o=T[r],s=M[r],E[2*r]=o===p?NaN:o,E[2*r+1]=s===p?NaN:s;if("log"===y.type)for(r=0;r1&&a.extendFlat(s.line,h.linePositions(t,r,n));if(s.errorX||s.errorY){var l=h.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},h.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},h.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},h.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,E,T,M),O=d(t,x);return c(m,e),w?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=l(e,_),u(t,e,y,b,T,M,C),L.errorX&&v(e,y,L.errorX),L.errorY&&v(e,b,L.errorY),L.fill&&!O.fill2d&&(O.fill2d=!0),L.marker&&!O.scatter2d&&(O.scatter2d=!0),L.line&&!O.line2d&&(O.line2d=!0),!L.errorX&&!L.errorY||O.error2d||(O.error2d=!0),L.text&&!O.glText&&(O.glText=!0),L.marker&&(L.marker.snap=_),O.lineOptions.push(L.line),O.errorXOptions.push(L.errorX),O.errorYOptions.push(L.errorY),O.fillOptions.push(L.fill),O.markerOptions.push(L.marker),O.markerSelectedOptions.push(L.markerSel),O.markerUnselectedOptions.push(L.markerUnsel),O.textOptions.push(L.text),O.textSelectedOptions.push(L.textSel),O.textUnselectedOptions.push(L.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=T,k.y=M,k.positions=E,O.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":436,"../../lib":458,"../../plots/cartesian/autorange":504,"../../plots/cartesian/axis_ids":508,"../scatter/calc":614,"../scatter/colorscale_calc":616,"./constants":643,"./convert":644,"./scene_update":652,"point-cluster":237}],643:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],644:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,h=o.family,d={},p=e.texttemplate;if(p){d.text=[];var g=a._d3locale,v=Array.isArray(p),y=v?Math.min(p.length,i):i,b=v?function(t){return p[t]}:function(){return p};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(a=0;a1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=v[d],m=v[p],y=c?c/.8+1:0,b=-m*y-.5*m;o.offset[a]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":352,"../../components/fx/helpers":366,"../../constants/interactions":435,"../../lib":458,"../../lib/gl_format_color":455,"../../plots/cartesian/axis_ids":508,"../../registry":551,"../scatter/make_bubble_size_func":630,"../scatter/subtypes":637,"./constants":643,"./helpers":648,"color-normalize":61,"fast-isnumeric":152,"svg-path-sdf":282}],645:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),u=t("../scatter/xy_defaults"),c=t("../scatter/marker_defaults"),f=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,p){function g(r,a){return n.coerce(t,e,o,r,a)}var v=!!t.marker&&i.isOpenSymbol(t.marker.symbol),m=l.isBubble(t),y=u(t,e,p,g);if(y){var b=y100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":643}],649:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=a.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=a.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=a.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.mc=a.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=a.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var k=a.extendFlat({},t,{color:i(o,h),x0:m-b,x1:m+b,xLabelVal:h.x,y0:y-b,y1:y+b,yLabelVal:h.y,cd:A,distance:u,spikeDistance:c,hovertemplate:h.ht});return h.htx?k.text=h.htx:h.tx?k.text=h.tx:o.text&&(k.text=o.text),a.fillText(h,o,k),n.getComponentMethod("errorbars","hoverInfo")(h,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,f,h,d,p=t.cd,g=p[0].t,v=p[0].trace,m=t.xa,y=t.ya,b=g.x,x=g.y,_=m.c2p(e),w=y.c2p(r),A=t.distance;if(g.tree){var k=m.p2c(_-A),T=m.p2c(_+A),M=y.p2c(w-A),E=y.p2c(w+A);a="x"===n?g.tree.range(Math.min(k,T),Math.min(y._rl[0],y._rl[1]),Math.max(k,T),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(k,T),Math.min(M,E),Math.max(k,T),Math.max(M,E))}else a=g.ids;var S=A;if("x"===n)for(u=0;u-1;u--)s=b[a[u]],l=x[a[u]],c=m.c2p(s)-_,f=y.c2p(l)-w,(h=Math.sqrt(c*c+f*f))m.glText.length){var w=x-m.glText.length;for(p=0;pr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var k=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(k)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,x),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,h,d=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],a=0,i=0;i-1;for(p=0;ph?2*(x.sizeAvg||Math.max(x.size,3)):i(e,b),d=0;di&&l||a-1,M=!0;if(o(b)||!!d.selectedpoints||T){var E=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var S=d.selectedpoints,C={};for(l=0;l=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],261:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],269:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],270:[function(t,e,r){"use strict";var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return v(0,M-1),M-=1,b(0),t}return-1}function w(t,e){var r=k[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((M+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}var k=[],T=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=T[e],a=T[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:S,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":262,"simplicial-complex":270}],273:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,i),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":273,"binary-search-bounds":274,"functional-red-black-tree":156,"robust-orientation":262}],276:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],277:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;i.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var M=p[x].length/y*.5,E=.5+m[x]/y*.5;k.push("d"+x+"-"+E+"-"+M+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}i.push("}},"),f.length>0&&h.push("}}");var S=[];for(u=0;u<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===c||0===f)return[];var b=Math.sin(d*a/360),x=Math.cos(d*a/360),_=x*(e-l)/2+b*(r-u)/2,w=-b*(e-l)/2+x*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var k=function(t,e,r,n,i,o,l,u,c,f,h,d){var p=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===u?-1:1))*i/o*d,x=y*-o/i*h,_=f*b-c*x+(t+r)/2,w=c*b+f*x+(e+n)/2,A=(h-b)/i,k=(d-x)/o,T=(-h-b)/i,M=(-d-x)/o,E=s(1,0,A,k),S=s(A,k,T,M);return 0===u&&S>0&&(S-=a),1===u&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,u,c,f,g,m,b,x,_,w),T=n(k,4),M=T[0],E=T[1],S=T[2],C=T[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var D=0;De[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":10,assert:15,"is-svg-path":213,"normalize-svg-path":281,"parse-svg-path":228}],281:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":279}],282:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||a(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d));if(c.translate(.5*r,.5*f),c.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),d&&c.stroke(m)}else{var y=i(t);o(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":39,"draw-svg-path":87,"is-svg-path":213,"parse-svg-path":228,"svg-path-bounds":280}],283:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(f+=.02);var d=new Float32Array(c),p=0,g=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=C(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16)),R(P(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var z,N,B,j=(N="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",B="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],285:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":292}],294:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":300}],295:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":291,"./is":296}],296:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":290}],297:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":294}],298:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":294,"../value/is":300}],299:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":291,"./is":300}],300:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],301:[function(t,e,r){(function(e){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=e.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=a([32,0])),u.BIGUINT64||(u.BIGUINT64=a([32,0])),u.BIGINT64||(u.BIGINT64=a([32,0])),u.BUFFER||(u.BUFFER=a([32,0]));var c=u.DATA,f=u.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function k(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=k,r.mallocDataView=T,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":38,buffer:50,dup:89}],302:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":77}],313:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":312}],314:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],315:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":495,"../../plots/cartesian/constants":511,"../../plots/font_attributes":533,"./arrow_paths":314}],316:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":458,"../../plots/cartesian/axes":505,"./draw":321}],317:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var G=!1,q=["x","y"],X=0;X1)&&(tt===K?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(G=!0):G=!0),W=et._offset+et.r2p(e[$]),J=.5}else"x"===$?(Z=e[$],W=x.l+x.w*Z):(Z=1-e[$],W=x.t+x.h*Z),J=e.showarrow?.5:Z;if(e.showarrow){lt.head=W;var ct=e["a"+$];Q=nt*U(.5,e.xanchor)-at*U(.5,e.yanchor),tt===K?(lt.tail=et._offset+et.r2p(ct),Y=Q):(lt.tail=W+ct,Y=Q+ct),lt.text=lt.tail+Q;var ft=b["x"===$?"width":"height"];if("paper"===K&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),dt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):dt>0&&(lt.tail-=dt,lt.text-=dt)}lt.tail+=st,lt.head+=st}else Y=Q=it*U(J,ot),lt.text=W+Q;lt.text+=st,Q+=st,Y+=st,e["_"+$+"padplus"]=it/2+Y,e["_"+$+"padminus"]=it/2-Y,e["_"+$+"size"]=it,e["_"+$+"shift"]=Q}if(G)R.remove();else{var pt=0,gt=0;if("left"!==e.align&&(pt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(D-y)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:F+pt-1,y:F+gt}).call(u.setClipUrl,N?M:null,t);else{var vt=F+gt-p.top,mt=F+pt-p.left;V.call(f.positionText,mt,vt).call(u.setClipUrl,N?M:null,t)}B.select("rect").call(u.setRect,F,F,w,D),z.call(u.setRect,I/2,I/2,P-I,j-I),R.call(u.setTranslate,Math.round(E.x.text-P/2),Math.round(E.y.text-j/2)),L.attr({transform:"rotate("+S+","+E.x.text+","+E.y.text+")"});var yt,bt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,p=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,b=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),O=+z.attr("width"),D=+z.attr("height"),I=m-.5*O,P=I+O,F=y-.5*D,N=F+D,B=[[I,F,I,N],[I,N,P,N],[P,N,P,F],[P,F,I,F]].map(M);if(!B.reduce((function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){B.forEach((function(t){var e=o.segmentsIntersect(h,p,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var j=e.arrowwidth,U=e.arrowcolor,V=e.arrowside,H=C.append("g").style({opacity:l.opacity(U)}).classed("annotation-arrow-g",!0),G=H.append("path").attr("d","M"+h+","+p+"L"+c+","+f).style("stroke-width",j+"px").call(l.stroke,l.rgb(U));if(g(G,V,e),_.annotationPosition&&G.node().parentNode&&!i){var q=c,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-p,2));q+=e.standoff*(h-c)/W,X+=e.standoff*(p-f)/W}var Y,Z,J=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-q)+","+(p-X),transform:"translate("+q+","+X+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:J.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);Y=t.x,Z=t.y,s&&s.autorange&&A(s._name+".autorange",!0),v&&v.autorange&&A(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,Z),a=n[0]+t,i=n[1]+r;R.call(u.setTranslate,a,i),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),k("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&bt(0,0),O)d.init({element:R.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",v.p2r(v.r2p(e.ay)+r)):k("ay",e.ay+r),bt(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;a=d.align(u+t/x.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var c=e._ysize/x.h,f=e.y-(e._yshift+e.yshift)/x.h-c/2;o=d.align(f-r/x.h,c,0,1,e.yanchor)}k("x",a),k("y",o),s&&v||(n=d.getCursor(s?.5:a,v?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),h(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",H(n))},doneFn:function(){h(R),a.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void O();if(m){if(m*m>b*b+x*x)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void O();var A=y*Math.cos(l),k=y*Math.sin(l);o.x-=A,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),M="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":540,"../annotations/draw":321}],328:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));X*=Z*u.roundUp(Y/Z,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=X}q.domain=[V+B,V+F-B],q.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,Q=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+k.cbaxis),K=0;function tt(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(r,n,c(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+z)*l.w,n=q.title.font.size;t="top"===T?(1-(V+F-B))*l.h+l.t+3+.75*n:(1-(V+B))*l.h+l.t-3-.25*n,tt(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=t.select("."+k.cbtitle),o=i.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=i.select(".h"+q._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*_),f?(K=h.bBox(f).height)>d&&(c[1]-=(K-d)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(K=h.bBox(o.node()).height),K){if(K+=5,"top"===T)q.domain[1]-=K/l.h,c[1]*=-1;else{q.domain[0]+=K/l.h;var p=g.lineCount(o);c[1]+=(1-p)*d}i.attr("transform","translate("+c+")"),q.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-q.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(O);m.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),m.exit().remove();var y=M.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));m.each((function(t,i){var o=[0===i?M[0]:(O[i]+O[i-1])/2,i===O.length-1?M[1]:(O[i]+O[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=S(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var b=t.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?D:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(q.c2p(t))+v.width/2%1)+"h"+R).call(h.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var x=j+R+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(q),A=s.makeTransFn(q),C=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,w):w,layer:$,path:s.makeTickPath(q,x,C),transFn:A}),s.drawLabels(r,q,{vals:w,layer:$,transFn:A,labelFns:s.makeLabelFns(q,x)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));tt("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+e.outlinewidth/2+h.bBox($.node()).width;if((J=Q.select("text")).node()&&!J.classed(k.jsPlaceholder)){var a,o=Q.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(Q.node()).right-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-G;t.select("."+k.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:j,y:G+e.ypad+("top"===T?K:0),width:Math.max(R,2),height:Math.max(u-2*e.ypad-K,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},p=w[e.yanchor],g=A[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*p,f.b=u*g):(f.t=f.b=0,f.yt=e.y+e.len*p,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=A[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*m;else{var y=s-R;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}i.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);f(t,u)},doneFn:function(){if(f(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":432,"../../lib":458,"../../lib/extend":451,"../../lib/setcursor":478,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"../../plots/cartesian/axis_defaults":507,"../../plots/cartesian/layout_attributes":519,"../../plots/cartesian/position_defaults":522,"../../plots/plots":543,"../../registry":551,"../color":330,"../colorscale/helpers":341,"../dragelement":349,"../drawing":352,"../titles":425,"./constants":332,d3:83,tinycolor2:284}],335:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":458}],336:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":331,"./defaults":333,"./draw":334,"./has_colorbar":335}],337:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var d=s+"auto",p=s+"min",g=s+"max",v=s+"mid",m=(o(h+d),o(h+p),o(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":474,"../colorbar/attributes":331,"./scales.js":345}],338:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":458,"./helpers":341,"fast-isnumeric":152}],339:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],347:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":458}],348:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],349:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":458,"../../plots/cartesian/constants":511,"./align":346,"./cursor":347,"./unhover":350,"has-hover":200,"has-passive-events":201,"mouse-event-offset":216}],350:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":449,"../../lib/events":450,"../../lib/throttle":483,"../fx/constants":364}],351:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],352:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,m=e.exports={};m.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,a){t.call(m.setPosition,e,r).call(m.setSize,n,a)},m.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);m.translatePoint(t,a,e,r)}))},m.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,u=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){m.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},m.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(m.dashLine,l,o)}))},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;m.symbolList.push(r,t,r+100,t+"-open"),m.symbolNames[r]=t,m.symbolFuncs[r]=e.f,e.needLine&&(m.symbolNeedLines[r]=!0),e.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(m.symbolNoFill[r]=!0)}));var b=m.symbolNames.length;function x(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.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=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},A=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(t,e,r,a,o,l){for(var c=o.length,f=k[a],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},m.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},m.pointStyle=function(t,e,r){if(t.size()){var a=m.makePointStyleFns(e);t.each((function(t){m.singlePointStyle(t,n.select(this),e,a,r)}))}},m.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=m.symbolNumber(t.mx||i.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so)d=o.outlierwidth,h=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(i.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=i.gradient,y=t.mgt;if(y?p=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var b=t.mgc;b?p=!0:b=v.color;var _=r.uid;p&&(_+="-"+t.i),m.gradient(e,a,_,y,[[0,b],[1,f]],"fill")}else s.fill(e,f);d&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,c=i.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=a.color,v=i.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,b=i.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,u=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",x(m.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=m.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var i=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var f=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};v(h,e,t.i);var d=e._meta||{};l=u.texttemplateString(l,f,s._d3locale,h,t,d)}var p=t.tp||e.textposition,g=E(t,e),y=a?a(t):t.tc||e.textfont.color;i.call(m.font,t.tf||e.textfont.family,g,y).text(l).call(c.convertToTspans,r).call(M,p,g,t.mrc)}else i.remove()}))}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=E(t,e);s.fill(a,i),M(a,o,l,t.mrc2||t.mrc)}))}};function S(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,u.extendFlat({},v)},m.setClipUrl=function(t,e,r){t.attr("clip-path",R(e,r))},m.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},m.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var I=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(I,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var P=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(P);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":366,"../../constants/alignment":432,"../../constants/interactions":435,"../../constants/xmlns_namespaces":437,"../../lib":458,"../../lib/svg_text_utils":482,"../../registry":551,"../../traces/scatter/make_bubble_size_func":630,"../../traces/scatter/subtypes":637,"../color":330,"../colorscale":342,"./symbol_defs":353,d3:83,"fast-isnumeric":152,tinycolor2:284}],353:[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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:83}],354:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],355:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(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),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":637,"../drawing":352,d3:83,"fast-isnumeric":152}],360:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":330,d3:83}],361:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":451,"../../plots/font_attributes":533,"./layout_attributes":371}],362:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=K+x[0]._offset,e.pointerY=tt+w[0]._offset,I="xval"in e?g.flat(l,e.xval):g.p2c(x,K),P="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!a(I[0])||!a(P[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(z=0;zX&&(Z.splice(0,X),rt=Z[0].distance),m&&0!==Y&&0===Z.length){q.distance=Y,q.index=!1;var h=B._module.hoverPoints(q,H,G,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=Y}))),h&&h.length){var d,p=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(d=it(v),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>d.spikeDistance)&&(Q.vLinePoint=d))}var y=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(d=it(b),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>d.spikeDistance)&&(Q.hLinePoint=d))}}}}}function at(t,e){for(var r,n=null,a=1/0,i=0;i1||Z.length>1)||"closest"===C&&$&&Z.length>1,Tt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Mt={hovermode:C,rotateLabels:kt,bgColor:Tt,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Et=S(Z,Mt,t);g.isUnifiedHover(C)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var w=x[s],A=w.datum;A.offset=w.dp,A.del=w.del}}}(Et,kt?"xa":"ya",c),L(Et,kt));if(e.target&&e.target.tagName){var St=p.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),St?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,bt))return;bt&&t.emit("plotly_unhover",{event:e,points:bt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:I,yvals:P})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:o},l=S(a,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function S(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},x=e.fontFamily||v.HOVERFONT,_=e.fontSize||v.HOVERFONTSIZE,w=t[0],A=w.xa,E=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",L=w[S],O=(String(L)||"").split(" ")[0],D=d.node().getBoundingClientRect(),R=D.top,I=D.width,P=D.height,F=void 0!==L&&w.distance<=e.hoverdistance&&("x"===i||"y"===i);if(F){var z,N,B=!0;for(z=0;za.width-S?(m=a.width-S,s.attr("d","M"+(S-k)+",0L"+S+","+M+k+"v"+M+(2*T+b.height)+"H-"+S+"V"+M+k+"H"+(S-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(T+b.width/2)+"v"+M+(2*T+b.height)+"H-"+(T+b.width/2)+"V"+M+k+"H-"+k+"Z")}else{var C,O,D;"right"===E.side?(C="start",O=1,D="",m=A._offset+A._length):(C="end",O=-1,D="-",m=A._offset),y=E._offset+(w.y0+w.y1)/2,u.attr("text-anchor",C),s.attr("d","M0,0L"+D+k+","+k+"V"+(T+b.height/2)+"h"+D+(2*T+b.width)+"V-"+(T+b.height/2)+"H"+D+k+"V-"+k+"Z");var I,P=b.height/2,F=R-b.top-P,z="clip"+a._uid+"commonlabel"+E._id;if(m=0?K-=rt:K+=2*T;var nt=et.height+2*T,at=$+nt>=P;return nt<=P&&($<=R?$=E._offset+2*T:at&&($=P-nt)),tt.attr("transform","translate("+K+","+$+")"),tt}var it=h.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return it.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,_)})),it.exit().remove(),it.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=f.combine(f.opacity(o)?o:f.defaultLine,u),d=f.combine(f.opacity(t.color)?t.color:f.defaultLine,u),p=t.borderColor||f.contrast(h),g=C(t,F,i,a,L,e),v=g[0],m=g[1],y=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||_,t.fontColor||p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),A=0,M=0;if(m&&m!==v){w.call(c.font,t.fontFamily||x,t.fontSize||_,d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var E=w.node().getBoundingClientRect();A=E.width+2*T,M=E.height+2*T}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:p});var S,O,D=y.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,N=t.ya._offset+(t.y0+t.y1)/2,B=Math.abs(t.x1-t.x0),j=Math.abs(t.y1-t.y0),U=D.width+k+T+A;if(t.ty0=R-D.top,t.bx=D.width+2*T,t.by=Math.max(D.height+2*T,M),t.anchor="start",t.txwidth=D.width,t.tx2width=A,t.offset=0,s)t.pos=z,S=N+j/2+U<=P,O=N-j/2-U>=0,"top"!==t.idealAlign&&S||!O?S?(N+=j/2,t.anchor="start"):t.anchor="middle":(N-=j/2,t.anchor="end");else if(t.pos=N,S=z+B/2+U<=I,O=z-B/2-U>=0,"left"!==t.idealAlign&&S||!O)if(S)z+=B/2,t.anchor="start";else{t.anchor="middle";var V=U/2,H=z+V-I,G=z-V;H>0&&(z-=H),G<0&&(z+=-G)}else z-=B/2,t.anchor="end";y.attr("text-anchor",t.anchor),A&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+N+")"+(s?"rotate("+b+")":""))})),it}function C(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=I(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,f=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,f,u,h,t.trace._meta)).replace(E,(function(e,r){return s=I(r,t.nameLength),""}))),[l,s]}function L(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],u=s*(k+T),f=u+s*(t.txwidth+T),h=0,d=t.offset;"middle"===i&&(u-=t.tx2width/2,f+=t.txwidth/2+T),e&&(d*=-A,h=t.offset*w),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+h)+","+(k+d)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+h)+"V"+(d-k)+"Z");var p=u+h,g=d+t.ty0-t.by/2+T,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),p="middle"===i?-t.bx/2-t.tx2width/2+T:-t.bx-T):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),p="middle"===i?t.bx/2-t.tx2width/2-T:t.bx+T)),a.call(l.positionText,p,g),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*T+h,d+t.ty0-t.by/2+T),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,d-t.by/2-1,t.tx2width,t.by+2))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function D(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||h){var g=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,A=a.spikethickness,k=a.spikecolor||_,T=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var M=a._counterDomainMin,E=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),E=Math.max(E,a.position)),b=l.l+M*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:k,"stroke-dasharray":c.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?A:-A),cy:m,r:A,fill:k}).classed("spikeline",!0)}if(p){var S,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(S=u.pointerX,C=u.pointerY):(S=n._offset+L.x,C=a._offset+L.y);var O,D,R=i.readability(L.color,g)<1.5?f.contrast(g):L.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,z=d.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(O=z,D=C),-1!==I.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,D=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":c.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:z-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function R(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function I(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":458,"../../lib/events":450,"../../lib/override_cursor":469,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"../../registry":551,"../color":330,"../dragelement":349,"../drawing":352,"../legend/defaults":382,"../legend/draw":383,"./constants":364,"./helpers":366,d3:83,"fast-isnumeric":152,tinycolor2:284}],368:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":458,"../color":330,"./helpers":366}],369:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,s=i("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!d&&!p)"independent"===k("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===k("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",k,w,b,y),y:c("y",k,A,x,m,_)}}else delete e.grid}function k(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,b,x=_("orientation");"h"===x?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),_("traceorder",h),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",b),_("valign"),a.noneOrAll(u,v,["x","y"]),_("title.text")&&(_("title.side","h"===x?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":458,"../../plot_api/plot_template":495,"../../plots/layout_attributes":541,"../../registry":551,"./attributes":380,"./helpers":386}],383:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],s=i.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,p=r._maxNameLength;r.entries?n=i.text:(n=l?i.label:s.name,s._meta&&(n=a.templateString(n,s._meta)));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?A(n,p):n),f.positionText(g,d.textGap,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(T,t,e,r).on("edit",(function(n){this.text(A(n,p)).call(T,t,e,r);var s=i.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),f=u[u.length-1],h=a.keyedContainer(s,"transforms["+f+"].styles","target","value.name");h.set(i.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):T(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function T(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*g;if(i){var h=u.bBox(i);o=h.height,s=h.width,n?u.setTranslate(a,0,.25*o):u.setTranslate(a,l,.75*o+l)}else{var p=t.select(n?".legendtext":".legendtitletext"),v=f.lineCount(p),m=p.node();o=c*v,s=m?u.bBox(m).width:0;var y=c*((v-1)/2-.3);n?f.positionText(p,d.textGap,-y):f.positionText(p,d.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function E(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,f="legend"+s._uid;if(e?(r=e.layer,f+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;h=y(e.entries,e)}var p=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),A=a.ensureSingleById(s._topdefs,"clipPath",f,(function(t){t.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));S.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,L.font).text(L.text),T(O,C,t,e)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),R=C.selectAll("g.groups").data(h);R.enter().append("g").attr("class","groups"),R.exit().remove();var I=R.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){e._main&&n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.textGap,p=d.itemGap,g=2*(c+p),v=E(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+_[0],c+_[1]+a._height+e/2+p),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=h+a._width,a._width+=p+h+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),A=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,T=y||m,S=i.width/2;a._maxWidth=Math.max(A?T&&"left"===w?o.l+o.w:S:k?T&&"right"===w?o.r+o.w:S:o.w,2*h);var C=0,L=0;r.each((function(t){var e=t[0].width+h;C=Math.max(C,e),L+=e})),b=null;var O=0;if(l){var D=0,R=0,I=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,_[0],_[1]+c+p+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),D=Math.max(D,e);var r=t+p;r+c+R>a._maxWidth&&(O=Math.max(O,R),R=0,I+=D+a.tracegroupgap,D=e),u.setTranslate(this,R,I),R+=r})),a._width=Math.max(O,R)+c,a._height=I+D+g}else{var P=r.size(),F=L+f+(P-1)*pa._maxWidth&&(O=Math.max(O,j),N=0,B+=z,a._height+=z,z=0),u.setTranslate(this,_[0]+c+N,_[1]+c+B+e/2+p),j=N+r+p,N+=n,z=Math.max(z,e)})),F?(a._width=N+f,a._height=z+g):(a._width=Math.max(O,j)+f,a._height+=z+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var U=t._context.edits,V=U.legendText||U.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?h:b||h+t[0].width;s||(a+=p/2),u.setRect(e,0,-r/2,a,r)}))}(t,R,I,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=E(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var c,h,p,y,b=s._size,x=e.borderwidth,w=b.l+b.w*e.x-v[M(e)]*e._width,k=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var T=w,L=k;w=a.constrain(w,0,s.width-e._width),k=a.constrain(k,0,s.height-e._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),k!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(g,w,k),D.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var O=e._effHeight;e._main||(O=e._height),S.attr({width:e._width-x,height:O-x,x:x/2,y:x/2}),u.setTranslate(C,0,0),A.select("rect").attr({width:e._width-2*x,height:O-2*x,x:x,y:x}),u.setClipUrl(C,f,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var R,I,P,F=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),z=e._effHeight-F-2*d.scrollBarMargin,N=e._height-e._effHeight,B=z/N,j=Math.min(e._scrollY||0,N);S.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),A.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+j}),u.setClipUrl(C,f,t),H(j,F,B),g.on("wheel",(function(){H(j=a.constrain(e._scrollY+n.event.deltaY/z*N,0,N),F,B),0!==j&&j!==N&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;R="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,P=j})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(j=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));D.call(U);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(R=t.changedTouches[0].clientY,P=j)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,H(j=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));C.call(V)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=u.getTranslate(g);p=t.x,y=t.y},moveFn:function(t,r){var n=p+t,a=y+r;u.setTranslate(g,n,a),c=l.align(n,0,b.l,b.l+b.w,e.xanchor),h=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(C,0,-r),u.setRect(D,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),A.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":432,"../../lib":458,"../../lib/events":450,"../../lib/svg_text_utils":482,"../../plots/plots":543,"../../registry":551,"../color":330,"../dragelement":349,"../drawing":352,"./constants":381,"./get_legend_data":384,"./handle_click":385,"./helpers":386,"./style":388,d3:83}],384:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,u={},c=0,f=0,h=e._main;function d(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;a=e.width}return p?n:Math.min(a,r)};function v(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},u=r?i.visible&&i.type===r:a.traceIs(i,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],a=g(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function m(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,d=g(f(h.width,o.pts),h,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=h.color;var v=i.minExtend(o,{trace:p});c(u,v,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(0,"+u+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=a.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,u=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,f=n.select(this),d=l(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;c=0===u?p[g?v-1:0][1]:1===u?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[u]||m[0]:m}f.attr("d",t[0]),c?f.call(s.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;o.gradient(t,e,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,v(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){v(t,this,"funnel")})).each((function(t){v(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:p?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){m(t,this,"funnelarea")})).each((function(t){m(t,this,"pie")})).each((function(t){var r,a,s=t[0],c=s.trace,f=c.visible&&c.fill&&"none"!==c.fill,d=u.hasLines(c),p=c.contours,v=!1,m=!1,y=l(c),b=y.colorscale,x=y.reversescale;if(p){var _=p.coloring;"lines"===_?v=!0:d="none"===_||"heatmap"===_||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=u.hasMarkers(c)||u.hasText(c),A=f||m,k=d||v,T=w||!A?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),E=M.select(".legendfill").selectAll("path").data(f||m?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),b,"fill")}}),d||v){var S=g(void 0,c.line,10,5);a=i.minExtend(c,{line:{width:S}}),r=[i.minExtend(s,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(d||v?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",T+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),b,"stroke")}})})).each((function(t){var r,a,s=t[0],l=s.trace,c=u.hasMarkers(l),f=u.hasText(l),h=u.hasLines(l);function d(t,e,r,n){var a=i.nestedProperty(l,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(p&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||f||h){var v={},m={};if(c){v.mc=d("marker.color",g),v.mx=d("marker.symbol",g),v.mo=d("marker.opacity",i.mean,[.2,1]),v.mlc=d("marker.line.color",g),v.mlw=d("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=d("marker.size",i.mean,[2,16],12);v.ms=y,m.marker.size=y}h&&(m.line={width:d("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=d("textposition",g),v.ts=10,v.tc=d("textfont.color",g),v.tf=d("textfont.family",g)),r=[i.minExtend(s,v)],(a=i.minExtend(l,m)).selectedpoints=null,a.texttemplate=null}var b=n.select(this).select("g.legendpoints"),x=b.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,a,e),c&&(r[0].mrc=3);var _=b.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":458,"../../registry":551,"../../traces/pie/helpers":606,"../../traces/pie/style_one":607,"../../traces/scatter/subtypes":637,"../color":330,"../colorscale/helpers":341,"../drawing":352,d3:83}],389:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):p?(E=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):d?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(E=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];h&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=f,S="y0",T=y,C="y1"):(k=y,S="y1",T=f,C="y0");W(n),J(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?Y:Z,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),Q(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;Q(s)}};function W(r){if(m(t))R=null;else if(F)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!z&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),R=l.split("-")[0]}}function Y(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=G(A+a)):(l=function(t){return G(V(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else I?N("xanchor",r.xanchor=H(b+n)):(N("x0",r.x0=H(u+n)),N("x1",r.x1=H(v+n))),P?N("yanchor",r.yanchor=G(A+a)):(N("y0",r.y0=G(f+a)),N("y1",r.y1=G(y+a)));e.attr("d",_(t,r)),J(s,r)}function Z(n,a){if(z){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=G(A+a)):(l=function(t){return G(V(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var c=u+n,h=P?f-a:f+a;N("x0",r.x0=I?c:H(c)),N("y0",r.y0=P?h:G(h))}else if("resize-over-end-point"===R){var d=v+n,p=P?y-a:y+a;N("x1",r.x1=I?d:H(d)),N("y1",r.y1=P?p:G(p))}}else{var m=function(t){return-1!==R.indexOf(t)},x=m("n"),q=m("s"),X=m("w"),W=m("e"),Y=x?k+a:k,Z=q?T+a:T,Q=X?M+n:M,$=W?E+n:E;P&&(x&&(Y=k-a),q&&(Z=T-a)),(!P&&Z-Y>10||P&&Y-Z>10)&&(N(S,r[S]=P?Y:G(Y)),N(C,r[C]=P?Z:G(Z))),$-Q>10&&(N(L,r[L]=I?Q:H(Q)),N(O,r[O]=I?$:H($)))}e.attr("d",_(t,r)),J(s,r)}function J(t,e){(I||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=U(I?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=V(P?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function Q(t){t.selectAll(".visual-cue").remove()}h.init(X),q.node().onmousemove=W}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",O||u.opacity(E)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,v(t)}}(t,I)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),m=t._fullLayout._size;if(d?(r=g.shapePositionToRange(d),n=function(t){return d._offset+d.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=g.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===h)return d&&"date"===d.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,f=b-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,_=(c+f)/2,w=Math.abs(x-l),A=Math.abs(_-c),k="A"+w+","+A,T=x+w+","+_;return"M"+T+k+" 0 1,1 "+(x+","+(_-A))+k+" 0 0,1 "+T+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),T&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===A&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function D(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,a=s.ensureSingle(t,"rect",c.railRectClass);a.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+c.groupClassName).data(r,v);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||f<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform","translate("+v+")")}}}return I.call(P),D&&(E?I.on(".opacity",null):(k=0,T=!0,I.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),I.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(P)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),I.classed("js-placeholder",T),w}}},{"../../constants/alignment":432,"../../constants/interactions":435,"../../lib":458,"../../lib/svg_text_utils":482,"../../plots/plots":543,"../../registry":551,"../color":330,"../drawing":352,d3:83,"fast-isnumeric":152}],426:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":451,"../../plot_api/edit_types":488,"../../plot_api/plot_template":495,"../../plots/font_attributes":533,"../../plots/pad_attributes":542,"../color/attributes":329}],427:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],428:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":458,"../../plots/array_container_defaults":501,"./attributes":426,"./constants":427}],429:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(M,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(E,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(A,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(A,o),c.call(_,o)}))})),c.call(_,o),b?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,T=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,E=p,S=v+m;S+M>u&&(S=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:T,height:M}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=m>A,O=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+O>l&&(R=l-O);var P=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:O,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,z=c-.5,N=L?f+O+.5:f+.5,B=h-.5,j=k?d+M+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(k||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||L?(this._clipRect=U.select("rect").attr({x:Math.floor(z),y:Math.floor(B),width:Math.ceil(N)-Math.floor(z),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||L){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(H),L&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":458,"../color":330,"../drawing":352,d3:83}],432:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],433:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],434:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],435:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],436:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],437:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],438:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],441:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],442:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":465}],443:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||u(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var k=A[1],T=A[3]||"1",M=Number(A[5]||1),E=Number(A[7]||0),S=Number(A[9]||0),C=Number(A[11]||0);if(u){if(2===k.length)return c;var L;k=Number(k);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),L=O.newDate(k,O.toMonthIndex(k,T,D),M)}else L=O.newDate(k,Number(T),M)}catch(t){return c}return L?(L.toJD()-g)*f+E*h+S*d+C*p:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var R=new Date(Date.UTC(2e3,T,M,E,S));return R.setUTCFullYear(k),R.getUTCMonth()!==T||R.getUTCDate()!==M?c:R.getTime()+C*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,k=3*h,T=5*d;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var L=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+L);return u.setUTCMonth(u.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":465}],455:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;xo?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(a||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var a;return C.test(n)?a=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,a=r[n]()),l.isValidTextValue(a)?a:""}))};var L={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return R.apply(L,arguments)};var O={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return R.apply(O,arguments)};var D=/^[:|\|]/;function R(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,f,h,d;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var I=2e9;l.seedPseudoRandom=function(){I=2e9},l.pseudoRandom=function(){var t=I;return I=(69069*I+1)%4294967296,Math.abs(I-t)<429496729?l.pseudoRandom():I/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(a-u*(r+o))+","+(i-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":436,"./anchor_utils":441,"./angles":442,"./array":443,"./clean_number":444,"./clear_responsive":446,"./coerce":447,"./dates":448,"./dom":449,"./extend":451,"./filter_unique":452,"./filter_visible":453,"./geometry2d":454,"./identity":457,"./is_plain_object":459,"./keyed_container":460,"./localize":461,"./loggers":462,"./make_trace_groups":463,"./matrix":464,"./mod":465,"./nested_property":466,"./noop":467,"./notifier":468,"./push_unique":472,"./regex":474,"./relative_attr":475,"./relink_private":476,"./search":477,"./stats":480,"./throttle":483,"./to_log_range":484,d3:83,"fast-isnumeric":152}],459:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],460:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":493,"./notifier":468}],463:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:83}],464:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],466:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":436,"./matrix":464}],471:[function(t,e,r){(function(r){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":479,regl:259}],472:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":443,"fast-isnumeric":152}],481:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":61}],482:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,T){var M=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],i,(function(n,a,i){C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void e();var l=C.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:L,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||s(t,"height"))/4;"y"===L[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?o.attr({x:t.attr("x"),y:p-h/2}):"a"===L[0]&&0!==L.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-h/2}),T&&T.call(t,l),e(l)}))}))):O(),t}function O(){C.empty()||(L=t.attr("class")+"-math",C.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}y.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(v),L=0;L|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(v),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):T[e])||t}))}function S(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="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:a()-u.top+"px",left:i()-u.left+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(v),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],484:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":152}],485:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],486:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],487:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,k,T,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=c(m,f).get(),O=[],D=-1,R=C.length;for(b=0;bC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==k)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?O.push(_):T?("add"===k&&(k={}),C.splice(_,0,k),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===D&&(D=_);else for(x=0;x=0;b--)C.splice(O[b],1),L&&L.splice(O[b],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(h(v,m),p!==a){var I;if(-1===D)I=E;else{for(R=Math.max(C.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(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]),R(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&R(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in R(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=D(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function H(t,e,r){if(t=o.getGraphDiv(t),A.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Z(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(G(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(k.doLegend),i.layoutstyle&&s.push(k.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(k.doTicksRelayout),i.modebar&&s.push(k.doModeBar),i.camera&&s.push(k.doCamera),i.colorbars&&s.push(k.doColorBars),s.push(S)),s.push(h.rehover,h.redrag),u.add(t,H,[t,a.undoit],H,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function G(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=p.getFromId(t,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=B(l._preGUI,u),d=Object.keys(e),g=p.list(t),v=o.extendDeepAll({},e),m={};for(V(e),d=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var F=R.parts[P],z=R.parts[P-1]+"."+F,j=R.parts.slice(0,P).join("."),U=s(t.layout,j).get(),H=s(l,j).get(),G=R.get();if(void 0!==I){k[D]=I,E[D]="reverse"===F?I:N(G);var q=f.getLayoutValObject(l,R.parts);if(q&&q.impliedEdits&&null!==I)for(var Z in q.impliedEdits)S(o.relativeAttr(D,Z),q.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(I){S("autosize",null);var Q="height"===D?"width":"height";S(Q,l[Q])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",I?null:l.width),S("height",I?null:l.height);else if(z.match(X))O(z),s(l,j+"._inputRange").set(null);else if(z.match(W)){O(z),s(l,j+"._inputRange").set(null);var $=s(l,j).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else z.match(Y)&&s(l,j+"._inputDomain").set(null);if("type"===F){var K=U,tt="linear"===H.type&&"log"===I,et="log"===H.type&&"linear"===I;if(tt||et){if(K&&K.range)if(H.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&S(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(j+".range[0]",Math.log(rt)/Math.LN10),S(j+".range[1]",Math.log(nt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,rt)),S(j+".range[1]",Math.pow(10,nt)))}else S(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,I,S),c.getComponentMethod("images","convertCoords")(t,H,I,S)}else S(j+".autorange",!0),S(j+".range",null);s(l,j+"._inputRange").set(null)}else if(F.match(M)){var at=s(l,D).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,at,it,S),c.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(D);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=q||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(I)?E[D]=null:w.isRemoveVal(I)?E[D]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,lt),m[r]||(m[r]={});var ut=m[r][n];ut||(ut=m[r][n]={}),ut[st]=I,delete e[D]}else"reverse"===F?(U.range?U.range.reverse():(S(j+".autorange",!0),U.range=[1,0]),H.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==G&&"select"!==G||l._has("gl2d")?_.plot=!0:q?T.update(_,q):_.calc=!0,R.set(I))}}for(r in m){w.applyContainerArrayChanges(t,h(i,r),m[r],_,h)||(_.plot=!0)}var ct=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,A.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&kk)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&E<5&&(E++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===E&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=i[o])}return x(a,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":458,"../plots/attributes":502}],496:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=A(c,k,c.side),c._mainMirrorPosition=c.mirror&&k?A(c,k,d.OPPOSITE_SIDE[c.side]):null}var T=[],M=[],E=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,L=s.yaxis.domain,O=s.plotgroup;if(y(C,L,E)){var D=O.node(),R=s.bg=o.ensureSingle(O,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),M.push(a)}else O.select("rect.bg").remove(),E.push([C,L]),S||(T.push(a),M.push(a))}var I,P,F,z,N,B,j,U,V,H,G,q,X,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":458,"../plots/attributes":502,"../plots/plots":543,"./plot_config":493,"./plot_schema":494,"./plot_template":495}],498:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var M=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(k);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var d=i.graphJson(k,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,T,M).then(E).then(S).then(C).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":458,"../plots/plots":543,"../snapshot/helpers":555,"../snapshot/svgtoimg":557,"../snapshot/tosvg":559,"../version":665,"./plot_api":492,"fast-isnumeric":152}],499:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var T,M,E,S,C,L=b.length,O=Array.isArray(k);if(O&&(L=Math.min(L,k.length)),2===x.dimensions)for(M=0;Mb[M].length&&a.push(p("unused",i,m.concat(M,b[M].length)));var D=b[M].length;for(T=0;T<(O?Math.min(D,k[M].length):D);T++)E=O?k[M][T]:k,S=y[M][T],C=b[M][T],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(M,T),S,C)):a.push(p("value",i,m.concat(M,T),S))}else a.push(p("array",i,m.concat(M),y[M]));else for(M=0;M1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((x=T-o(v)-o(m))>M?_/x>S&&(y=v,b=m,S=_/x):_/T>S&&(y={val:v.val,pad:0},b={val:m.val,pad:0},S=_/T));if(h===d){var C=h-1,L=h+1;if(A)if(0===h)i=[0,1];else{var O=(h>0?f:c).reduce((function(t,e){return Math.max(t,o(e))}),0),D=h/(1-Math.min(.5,O/T));i=h>0?[0,D]:[D,0]}else i=k?[Math.max(0,C),Math.max(1,L)]:[C,L]}else A?(y.val>=0&&(y={val:0,pad:0}),b.val<=0&&(b={val:0,pad:0})):k&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),b.val<=0&&(b={val:1,pad:0})),S=(b.val-y.val-E(v.val,m.val))/(T-o(y)-o(b)),i=[y.val-S*o(y),b.val+S*o(b)];return p&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function d(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,s,l,u,h,p,g,v,m=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,A=!1,k=r.vpadLinearized||!1;function T(t){if(Array.isArray(t))return A=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!A){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":436,"../../lib":458,"../../registry":551,"fast-isnumeric":152}],505:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),p=t("../../constants/numerical"),g=p.ONEAVGYEAR,v=p.ONEAVGMONTH,m=p.ONEDAY,y=p.ONEHOUR,b=p.ONEMIN,x=p.ONESEC,_=p.MINUS_SIGN,w=p.BADNUM,A=t("../../constants/alignment"),k=A.MID_SHIFT,T=A.CAP_SHIFT,M=A.LINE_SPACING,E=A.OPPOSITE_SIDE,S=e.exports={};S.setConvert=t("./set_convert");var C=t("./axis_autotype"),L=t("./axis_ids");S.id2name=L.id2name,S.name2id=L.name2id,S.cleanId=L.cleanId,S.list=L.list,S.listIds=L.listIds,S.getFromId=L.getFromId,S.getFromTrace=L.getFromTrace;var O=t("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes;function D(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}S.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||i),i||(i=a),c[u]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,c,u)},S.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var u=S.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},S.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:S.getFromId(e,r).cleanPos)(t)},S.redrawComponents=function(t,e){e=e||S.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},S.saveRangeInitial=function(t,e){for(var r=S.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=S.tickIncrement(t,"M6","reverse")+1.5*m:i.exactMonths>.8?t=S.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=S.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,y,u,i)),v=b,0;v<=c;)v=S.tickIncrement(v,y,!1,i);return{start:e.c2r(b,0,i),end:e.c2r(v,0,i),size:y,_dataSpan:c-u}},S.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/a,S.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),G(t)},S.calcTicks=function(t,e){S.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=D(s.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ci&&f=o:n<=o)&&!(u.length>r||n===e);n=S.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var a=!1;c&&n!==(0|n)&&(a=!0),u.push({minor:a,value:n})}}(),t.rangebreaks){var f=u.length;if(f){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var d,p=[],g=l?1:-1,v=l?f-1:0,m=l?0:f-1;g*m<=g*v;m+=g){var y=u[m];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var b=t.c2p(y.value);b===d?p[p.length-1].valueh)&&(d=b,p.push(y))}}u=p.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&i<=10||e>=15*m)t._tickround="d";else if(e>=b&&i<=16||e>=y)t._tickround="M";else if(e>=x&&i<=19||e>=b)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(W(t.exponentformat)&&!Y(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function q(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*H(e,r,F)):i>v?(e/=v,t.dtick="M"+H(e,1,z)):i>m?(t.dtick=H(e,m,t._hasDayOfWeekBreaks?[1,2,7,14]:B),t.tick0=s.dateTick0(t.calendar,!0)):i>y?t.dtick=H(e,y,z):i>b?t.dtick=H(e,b,N):i>x?t.dtick=H(e,x,N):(r=n(10),t.dtick=H(e,r,F))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+H(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=H(e,r,V)):(t.tick0=0,r=n(10),t.dtick=H(e,r,F));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},S.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?U:j,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},S.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Z(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||W(d)&&Y(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":_)+h:(e.text=Z(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=Z(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=Z(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=Z(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},S.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return S.hoverLabelText(t,e)+" - "+S.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=S.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var X=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Y(t){return t>14||t<-15}function Z(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=S.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};G(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":W(l)&&(t+=X[u/3+5]));return i?_+t:t}function J(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,f),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==h._dfltTitle[p]&&(n[l]+=$(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[u]+=f),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Y&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,et(e),n),i.autoMargin(t,rt(e),a),i.autoMargin(t,nt(e),s)})),r.skipTitle||Y&&"bottom"===e.side||X.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+$(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,d=S.getPxPosition(t,e);"x"===i?(l=e._offset+e._length/2,c="top"===e.side?d-r:d+r):(c=e._offset+e._length/2,l="right"===e.side?d+r:d-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(h={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var g=f.getTranslate(p.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(X)}}function Z(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=tt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},S.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},S.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},S.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},S.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,d,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(d="bottom"===t.side?1:-1,c=l*d,f=e+o*d,h="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+f+t.fontSize*h},p.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*d<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(d="right"===t.side?1:-1,c=o,f=-l*d,h=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*d},p.yFn=function(t){return t.dy+f+t.fontSize*k},p.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},S.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],Q);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&S.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*b)||A)for(r=0;rR&&FO&&(O=F);d/=(O-L)/(2*D),L=u.l2r(L),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function z(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function N(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function B(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,a,i)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function U(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){L&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),L=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function G(t,e,r,n){for(var a,i,o,l,u=!1,c={},f={},h=0;h=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(U(a),2!==t||pt||Ut(),dt)i.indexOf("select")>-1&&T(r,a,Z,J,e.id,St),i.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&&pt){var s=g?j:O,u="s"===g||"w"===L?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,u),d="left",p="middle";if(s.fixedrange)return;g?(p="n"===g?"top":"bottom","right"===s.side&&(d="right")):"e"===L&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(mt).call(l.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:p}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",a,c,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,e+yt)),a=Math.max(0,Math.min(tt,r+bt)),i=Math.abs(n-yt),o=Math.abs(a-bt);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Mt.attr("d","M0,0Z")}if(xt.l=Math.min(yt,n),xt.r=Math.max(yt,n),xt.t=Math.min(bt,a),xt.b=Math.max(bt,a),et.isSubplotConstrained)i>C||o>C?(kt="xy",i/K>o/tt?(o=i*tt/K,bt>a?xt.t=bt-o:xt.b=bt+o):(i=o*K/tt,yt>n?xt.l=yt-i:xt.r=yt+i),Mt.attr("d",H(xt))):s();else if(rt.isSubplotConstrained)if(i>C||o>C){kt="xy";var l=Math.min(xt.l/K,(tt-xt.b)/tt),u=Math.max(xt.r/K,(tt-xt.t)/tt);xt.l=l*K,xt.r=u*K,xt.b=(1-l)*tt,xt.t=(1-u)*tt,Mt.attr("d",H(xt))}else s();else!at||og[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":458,"fast-isnumeric":152}],523:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":432}],524:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),A=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),T=k.MINSELECT,M=b.filter,E=b.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),L=C.p2r,O=C.axValue,D=C.getTransform;function R(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){z(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!j){var r=Y.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&R(e,W,a.xaxes,a.yaxes,a.subplot,a,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},a.doneFn=function(){ft.remove(),x.done(ht).then((function(){x.clear(ht),a.gd.emit("plotly_selected",S),_&&a.selectionDefs&&(_.subtract=st,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,b)),a.doneFnCompleted&&a.doneFnCompleted(dt)})).catch(y.error),j&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:R}},{"../../components/color":330,"../../components/dragelement/helpers":348,"../../components/drawing":352,"../../components/fx":370,"../../components/fx/helpers":366,"../../components/shapes/draw_newshape/display_outlines":415,"../../components/shapes/draw_newshape/helpers":416,"../../components/shapes/draw_newshape/newshapes":417,"../../lib":458,"../../lib/clear_gl_canvases":445,"../../lib/polygon":470,"../../lib/throttle":483,"../../plot_api/subroutines":496,"../../registry":551,"./axis_ids":508,"./constants":511,"./handle_outline":515,"./helpers":516,polybooljs:241}],525:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,u=i.ensureNumber,c=i.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,b=t("./axis_ids"),x=t("./constants"),_=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function T(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*p*Math.abs(n-a))}return d}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===d){if(!a(e))return d;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function E(e,r,n){return s(e,r,n||t.calendar)}function S(e){return t._categories[Math.round(e)]}function C(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function L(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=L(t);return void 0!==e?e:a(t)?+t:void 0}function D(t,e,r){return n.round(r+e*t,2)}function R(t,e,r){return(t-r)/e}var I=function(e){return a(e)?D(e,t._m,t._b):d},P=function(e){return R(e,t._m,t._b)};if(t.rangebreaks){var F="y"===f;I=function(e){if(!a(e))return d;var r=t._rangebreaks.length;if(!r)return D(e,t._m,t._b);var n=F;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var f=t._B[s]||0;return isFinite(f)?D(e,t._m2,f):0},P=function(e){var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return R(e,t._m2,t._B[n])}}t.c2l="log"===t.type?T:u,t.l2c="log"===t.type?A:u,t.l2p=I,t.p2l=P,t.c2p="log"===t.type?function(t,e){return I(T(t,e))}:I,t.p2c="log"===t.type?function(t){return A(P(t))}:P,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=P,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return T(o(t),e)},t.r2d=t.r2c=function(t){return A(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=T,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(P(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=P,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=E,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return E(P(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=C,t.r2d=t.c2d=t.l2d=S,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return S(P(t))},t.r2p=t.d2p,t.p2r=P,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=S,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=L,t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return S(P(t))},t.r2p=t.d2p,t.p2r=P,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;ah&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=b.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),h="y"===f;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;sa&&(a+=7,sa&&(a+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,A=h?c/d[3]:1,k=f?d[0]:0,T=h?d[1]:0,M=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,S=a._offset-M,C=l._offset-E;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":352,"../../lib":458,"../../registry":551,"./axes":505,d3:83}],530:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(v(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i1&&R.length>1){for(i.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(f,s,c,a),y.cleanPlot(f,s,c,a);var N=!(!a._has||!a._has("gl2d")),B=!(!s._has||!s._has("gl2d")),j=!(!a._has||!a._has("cartesian"))||N,U=!(!s._has||!s._has("cartesian"))||B;j&&!U?a._bgLayer.remove():U&&!j&&(s._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&h({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=y.layoutAttributes.width.min,d=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,u=i.componentsRegistry,c=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in u)(s=u[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:f,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),S(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,d=e.height,p=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in p)g[v]||delete p[v];for(var m in p.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},p){var b=p[m].l||{},x=p[m].b||{},_=b.val,w=b.size,A=x.val,k=x.size;for(var T in p){if(a(w)&&p[T].r){var M=p[T].r.val,E=p[T].r.size;if(M>_){var C=(w*M+(E-h)*_)/(M-_),L=(E*(1-_)+(w-h)*(1-M))/(M-_);C>=0&&L>=0&&h-(C+L)>0&&C+L>s+u&&(s=C,u=L)}}if(a(k)&&p[T].t){var O=p[T].t.val,D=p[T].t.size;if(O>A){var R=(k*O+(D-d)*A)/(O-A),I=(D*(1-A)+(k-d)*(1-O))/(O-A);R>=0&&I>=0&&d-(I+R)>0&&R+I>f+c&&(f=R,c=I)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(d)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var P=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(f.layout=c(s)),t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),u&&(f.frames=c(u)),i&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:c,y:c}]),i[0].t||(i[0].t={}),i[0].trace=r,p[e]=i}}for(D(u,h,d),a=0;a=0?h.angularAxis.domain:n.extent(A),S=Math.abs(A[1]-A[0]);T&&!k&&(S=0);var C=E.slice();M&&k&&(C[1]+=S);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=h.angularAxis.ticksStep||(C[1]-C[0])/(L*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var R=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));t=n.select(I)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var P,F=t.select(".chart-group"),z={fill:"none",stroke:h.tickColor},N={"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){P=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var B=d.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:d.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:P,elements:B,reverseOrder:h.legend.reverseOrder})})();var j=P.node().getBBox();b=Math.min(h.width-j.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],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),P.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else P=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(j?j.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(N).text(h.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var G=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var q=G.selectAll("circle.grid-circle").data(r.ticks(5));q.enter().append("circle").attr({class:"grid-circle"}).style(z),q.attr("r",r),q.exit().remove()}G.select("circle.outside-circle").attr({r:b}).style(z);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),G.selectAll(".domain").style(z),G.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(N).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,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),J.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(z),J.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(N);var Q=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:i+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,a=h.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(N);h.angularAxis.rewriteTicks&&Q.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(F.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));P.attr({transform:"translate("+[b+$,h.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||K){var et=[];d.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(X).radius);var a=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,a,i)},"stroke-width":function(t,e){return p["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,a,i)},opacity:function(t,e){return p.opacity(r,a,i)},display:function(t,e){return p.display(r,a,i)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=u),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var h=i.padding,d=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[i.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*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":432,"../../../lib":458,d3:83}],548:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,a,i,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return a.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},h.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.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:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":330,"../../../lib":458,"./micropolar":547,"./undo_manager":549,d3:83}],549:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":330,"../components/drawing":352,"../constants/xmlns_namespaces":437,"../lib":458,d3:83}],560:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===v?h=g.showlines=!0:(h=r("contours.showlines"),p=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(d=r("line.color",p&&s(p)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,d,f)}},{"../../components/color":330,"../../constants/filter_ops":434,"./label_defaults":568,"fast-isnumeric":152}],565:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],566:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./constraint_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,a){return n.coerce(t,e,l,r,a)}if(a(t,e,c,u)){c("text"),c("hovertext"),c("hovertemplate"),c("hoverongaps");var f="constraint"===c("contours.type");c("connectgaps",n.isArray1D(e.z)),f?i(t,e,c,u,r):(o(t,e,c,(function(r){return n.coerce2(t,e,l,r)})),s(t,e,c,u))}else e.visible=!1}},{"../../lib":458,"../heatmap/xyz_defaults":584,"./attributes":561,"./constraint_defaults":564,"./contours_defaults":565,"./style_defaults":571}],567:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],568:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":458}],569:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1,c=a.extractOpts(t);isFinite(s)||(s=1,l=1);var f,h,d=c.reversescale?a.flipScale(c.colorscale):c.colorscale,p=d.length,g=new Array(p),v=new Array(p);if("heatmap"===e.coloring){var m=c.min,y=c.max;for(h=0;hr.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,h=t._input.contours;if(c>f&&(r.start=h.start=f,f=r.end=h.end=c,c=r.start),!(r.size>0))u=c===f?1:i(c,f,t.ncontours).dtick,h.size=r.size=u}}},{"../../lib":458,"../../plots/cartesian/axes":505}],571:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,u,o)}},{"../../components/colorscale/defaults":340,"./label_defaults":568}],572:[function(t,e,r){"use strict";var n=t("gl-contour2d"),a=t("gl-heatmap2d"),i=t("../../plots/cartesian/axes"),o=t("../contour/make_color_map"),s=t("../../lib/str2rgbarray");function l(t,e){this.scene=t,this.uid=e,this.type="contourgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.contourOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],levels:[0],levelColors:[0,0,0,1],lineWidth:1},this.contour=n(t.glplot,this.contourOptions),this.contour._trace=this,this.heatmapOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,0]},this.heatmap=a(t.glplot,this.heatmapOptions),this.heatmap._trace=this}var u=l.prototype;function c(t,e){for(var r=t.contours,n=r.start,a=r.end,i=r.size||1,l=e.fill,u=o(t),c=Math.floor((a-n)/i)+(l?2:1),f=new Array(c),h=new Array(4*c),d=0;dD){L("x scale is not linear");break}}if(m.length&&"fast"===S){var R=(m[m.length-1]-m[0])/(m.length-1),I=Math.abs(R/100);for(_=0;_I){L("y scale is not linear");break}}}var P=a.maxRowLength(x),F="scaled"===e.xtype?"":r,z=h(e,F,g,v,P,A),N="scaled"===e.ytype?"":m,B=h(e,N,y,b,x.length,k);E||(e._extremes[A._id]=i.findExtremes(A,z),e._extremes[k._id]=i.findExtremes(k,B));var j={x:z,y:B,z:x,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(F&&F.length===z.length-1&&(j.xCenter=F),N&&N.length===B.length-1&&(j.yCenter=N),M&&(j.xRanges=w.xRanges,j.yRanges=w.yRanges,j.pts=w.pts),T||s(t,e,{vals:x,cLetter:"z"}),T&&e.contours&&"heatmap"===e.contours.coloring){var U={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=h(U,F,g,v,P,A),j.yfill=h(U,N,y,b,x.length,k)}return[j]}},{"../../components/colorscale/calc":338,"../../constants/numerical":436,"../../lib":458,"../../plots/cartesian/axes":505,"../../registry":551,"../histogram2d/calc":593,"./clean_2d_array":576,"./convert_column_xyz":578,"./find_empties":580,"./interp2d":581,"./make_bound_array":582}],576:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":458}],581:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":458}],582:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,i),f(g+h,g+d,n,i)),m=Math.min(f(p+u,p+h,n,i),f(g+u,g+h,n,i));if(v>m&&mo){var y=s===a?1:6,b=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(ur.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),z||a.nestedProperty(e,m+".start").set(I.start)}var U=x.end,V=r.r2l(R.end),H=void 0!==V;if((x.endFound||H)&&V!==r.r2l(U)){var G=H?V:a.aggNums(Math.max,null,p);I.end=r.l2r(G),H||a.nestedProperty(e,m+".start").set(I.end)}var q="autobin"+s;return!1===e._input[q]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[q],delete e[q]),[I,p]}e.exports={calc:function(t,e){var r,i,d,p,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",b={x:"y",y:"x"}[y],x=e[y+"calendar"],_=e.cumulative,w=h(t,e,m,y),A=w[0],k=w[1],T="string"==typeof A.size,M=[],E=T?M:A,S=[],C=[],L=[],O=0,D=e.histnorm,R=e.histfunc,I=-1!==D.indexOf("density");_.enabled&&I&&(D=D.replace(/ ?density$/,""),I=!1);var P,F="max"===R||"min"===R?null:0,z=l.count,N=u[D],B=!1,j=function(t){return m.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[b])&&"count"!==R&&(P=e[b],B="avg"===R,z=l[R]),r=j(A.start),d=j(A.end)+(r-o.tickIncrement(r,A.size,!1,x))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var J=Math.min(g.length,v.length),Q=[],$=0,K=J-1;for(r=0;r=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=L[r],q?tt.ph0=tt.ph1=L[r].length?k[L[r][0]]:g[r]:(e._computePh=!0,tt.ph0=H(M[r]),tt.ph1=H(M[r+1],!0))),Q.push(tt)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,A.size,!1,x)-Q[0].p),s(Q,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Q,e,Y),Q},calcAllAutoBins:h}},{"../../lib":458,"../../plots/cartesian/axes":505,"../../registry":551,"../bar/arrays_to_calcdata":560,"./average":588,"./bin_functions":589,"./bin_label_vals":590,"./norm_functions":592,"fast-isnumeric":152}],592:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aE&&A.splice(E,A.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,D="string"==typeof T.size,R=[],I=[],P=O?R:w,F=D?I:T,z=0,N=[],B=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,G=i.count,q=o[j],X=!1,W=[],Y=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(X="avg"===U,G=i[U]);var J=w.size,Q=b(w.start),$=b(w.end)+(Q-a.tickIncrement(Q,J,!1,m))/1e6;for(r=Q;r<$;r=a.tickIncrement(r,J,!1,m))C.push(H),R.push(r),X&&L.push(0);R.push(r);var K,tt=C.length,et=(r-Q)/tt,rt=(K=Q+et/2,g.c2r(K,0,m)),nt=T.size,at=x(T.start),it=x(T.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],c=l,h=i;a*he){h=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[i],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var m=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function _(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),b(t.parentNode)}function w(t,e){var r=x(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function A(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||m()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=x(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){_(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),_(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,m(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&T(r)):T(r),i.brushCallback(e),b(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||T(r),i.brushCallback(e),u?b(t.parentNode,s):(s(),b(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function T(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(d).call(p).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(A).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(y);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?M(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":458,"../../lib/gup":456,"./constants":598,d3:83}],596:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":437,"../../plots/get_data":535,"./plot":605,d3:83}],597:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",m),n.coerceFont(c,"tickfont",m),n.coerceFont(c,"rangefont",m),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"../../lib":458,"../../plots/array_container_defaults":501,"../../plots/cartesian/axes":505,"../../plots/domain":532,"./attributes":594,"./axisbrush":595,"./constants":598,"./merge_length":603}],600:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":458}],601:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":594,"./base_plot":596,"./calc":597,"./defaults":599,"./plot":605}],602:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;ic&&(c=t[a].dim1.canvasX,o=a);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(E=E.slice(0,a._length));var S,C=a.tickvals;function L(t,e){return{val:t,text:S[e]}}function O(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){S=a.ticktext,Array.isArray(S)&&S.length?S.length>C.length?S=S.slice(0,C.length):C.length>S.length&&(C=C.slice(0,S.length)):S=C.map(n.format(a.tickformat));for(var D=1;D=r||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==I&&(c?a.hover(h):a.unhover&&a.unhover(h),I=f)}})),R.style("opacity",(function(t){return t.pick?0:1})),c.style("background","rgba(255, 255, 255, 0)");var P=c.selectAll("."+g.cn.parcoords).data(k,f);P.exit().remove(),P.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),P.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var F=P.selectAll("."+g.cn.parcoordsControlView).data(h,f);F.enter().append("g").classed(g.cn.parcoordsControlView,!0),F.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var z=F.selectAll("."+g.cn.yAxis).data((function(t){return t.dimensions}),f);z.enter().append("g").classed(g.cn.yAxis,!0),F.each((function(t){L(z,t)})),R.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=m(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),z.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),z.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;A.linePickActive(!1),t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,z.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),L(z,e),z.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),z.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!T(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,L(z,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!T(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),z.exit().remove();var N=z.selectAll("."+g.cn.axisOverlays).data(h,f);N.enter().append("g").classed(g.cn.axisOverlays,!0),N.selectAll("."+g.cn.axis).remove();var B=N.selectAll("."+g.cn.axis).data(h,f);B.enter().append("g").classed(g.cn.axis,!0),B.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return p.isOrdinal(t)?e:O(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(B.selectAll("text"),t.model.tickFont)})),B.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),B.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=N.selectAll("."+g.cn.axisHeading).data(h,f);j.enter().append("g").classed(g.cn.axisHeading,!0);var U=j.selectAll("."+g.cn.axisTitle).data(h,f);U.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),U.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=C(t.model.labelAngle,t.model.labelSide),r=g.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=C(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var V=N.selectAll("."+g.cn.axisExtent).data(h,f);V.enter().append("g").classed(g.cn.axisExtent,!0);var H=V.selectAll("."+g.cn.axisExtentTop).data(h,f);H.enter().append("g").classed(g.cn.axisExtentTop,!0),H.attr("transform","translate(0,"+-g.axisExtentOffset+")");var G=H.selectAll("."+g.cn.axisExtentTopText).data(h,f);G.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(S),G.text((function(t){return D(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var q=V.selectAll("."+g.cn.axisExtentBottom).data(h,f);q.enter().append("g").classed(g.cn.axisExtentBottom,!0),q.attr("transform",(function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"}));var X=q.selectAll("."+g.cn.axisExtentBottomText).data(h,f);X.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(S),X.text((function(t){return D(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),v.ensureAxisBrush(N)}},{"../../components/colorscale":342,"../../components/drawing":352,"../../lib":458,"../../lib/gup":456,"../../lib/svg_text_utils":482,"../../plots/cartesian/axes":505,"./axisbrush":595,"./constants":598,"./helpers":600,"./lines":602,"color-rgba":63,d3:83}],605:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===f[s]){var h=i.constraintrange;f[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":471,"./helpers":600,"./parcoords":604}],606:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),v=a(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=u.length<100||c.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=i(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":481,"../../plots/cartesian/autorange":504,"../scatter/get_trace_color":623,"gl-pointcloud2d":176}],610:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":458,"./attributes":608}],611:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":538,"../scatter3d/calc":640,"./attributes":608,"./convert":609,"./defaults":610}],612:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rs&&T[v].gap;)v--;for(y=T[v].s,p=T.length-1;p>v;p--)T[p].s=y;for(;sM[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],620:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=u(t,e,g,v),b=!y&&mq!=(z=D[L][1])>=q&&(I=D[L-1][0],P=D[L][0],z-F&&(R=I+(P-I)*(q-F)/(z-F),U=Math.min(U,R),V=Math.max(V,R)));U=Math.max(U,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:q,y1:q,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":330,"../../components/fx":370,"../../lib":458,"../../registry":551,"./get_trace_color":623}],625:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":518,"./arrays_to_calcdata":612,"./attributes":613,"./calc":614,"./cross_trace_calc":618,"./cross_trace_defaults":619,"./defaults":620,"./format_labels":622,"./hover":624,"./marker_colorbar":631,"./plot":633,"./select":634,"./style":636,"./subtypes":637}],626:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"../../lib":458}],627:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,A,k,T,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,D=S._length,R=e.connectGaps,I=e.baseTolerance,P=e.shape,F="linear"===P,z=e.fill&&"none"!==e.fill,N=[],B=f.minTolerance,j=t.length,U=new Array(j),V=0;function H(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;L&&l===a&&(i*=Math.abs(E._m*D*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function G(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,J]),ut(t),Q=null,Z=J=0}function ft(t){if(T=t[0]/O,M=t[1]/D,W=t[0]rt?rt:0,Y=t[1]at?at:0,W||Y){if(V)if(Q){var e=K(Q,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else $=K(U[V-1],t)[0],U[V++]=$;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?(Q&&(Z!==W&&J!==Y?ut(Z&&J?(n=Q,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||Y]):Z&&J&&ut([Z,J])),ut([W,Y])):Z-W&&J-Y&&ut([W||Z,Y||J]),Q=t,Z=W,J=Y}else Q&&ct(K(Q,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===P||"spline"===P?K=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)q(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}Q&&ut([Z||Q[0],J||Q[1]]),N.push(U.slice(0,V))}return N}},{"../../constants/numerical":436,"../../lib":458,"./constants":617}],628:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],629:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(e,a):0}}},{"fast-isnumeric":152}],631:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],632:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":330,"../../components/colorscale/defaults":340,"../../components/colorscale/helpers":341,"./subtypes":637}],633:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),k=o(A,"g","errorbars"),T=o(A,"g","lines"),M=o(A,"g","points"),E=o(A,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var S,C;y(A).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var O,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var F,z,N,B,j,U,V,H="",G="",q=[],X=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),z=l.steps(w.shape.split("").reverse().join(""))):F=z="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return z(t.reverse())},q=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),l.singleLineStyle(f,a)}}}}}var W=T.selectAll(".js-line").data(q);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),q.length?(S?(S.datum(f),B&&U&&(L?("y"===L?B[1]=U[1]=x.c2p(0,!0):"x"===L&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&R?("tonext"===_.fill?y(C).attr("d",H+"Z"+R+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+R.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(I)):(Z(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=V):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(p=v),h&&(g=v)}var A,k=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&k.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function Q(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":352,"../../lib":458,"../../lib/polygon":470,"../../registry":551,"./line_points":627,"./link_traces":629,"./subtypes":637,d3:83}],634:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=g,A=2*_,k={},T=e._x=y.makeCalcdata(e,"x"),M=e._y=b.makeCalcdata(e,"y"),E=new Array(A);for(r=0;r<_;r++)o=T[r],s=M[r],E[2*r]=o===p?NaN:o,E[2*r+1]=s===p?NaN:s;if("log"===y.type)for(r=0;r1&&a.extendFlat(s.line,h.linePositions(t,r,n));if(s.errorX||s.errorY){var l=h.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},h.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},h.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},h.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,E,T,M),O=d(t,x);return c(m,e),w?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=l(e,_),u(t,e,y,b,T,M,C),L.errorX&&v(e,y,L.errorX),L.errorY&&v(e,b,L.errorY),L.fill&&!O.fill2d&&(O.fill2d=!0),L.marker&&!O.scatter2d&&(O.scatter2d=!0),L.line&&!O.line2d&&(O.line2d=!0),!L.errorX&&!L.errorY||O.error2d||(O.error2d=!0),L.text&&!O.glText&&(O.glText=!0),L.marker&&(L.marker.snap=_),O.lineOptions.push(L.line),O.errorXOptions.push(L.errorX),O.errorYOptions.push(L.errorY),O.fillOptions.push(L.fill),O.markerOptions.push(L.marker),O.markerSelectedOptions.push(L.markerSel),O.markerUnselectedOptions.push(L.markerUnsel),O.textOptions.push(L.text),O.textSelectedOptions.push(L.textSel),O.textUnselectedOptions.push(L.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=T,k.y=M,k.positions=E,O.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":436,"../../lib":458,"../../plots/cartesian/autorange":504,"../../plots/cartesian/axis_ids":508,"../scatter/calc":614,"../scatter/colorscale_calc":616,"./constants":643,"./convert":644,"./scene_update":652,"point-cluster":237}],643:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],644:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,h=o.family,d={},p=e.texttemplate;if(p){d.text=[];var g=a._d3locale,v=Array.isArray(p),y=v?Math.min(p.length,i):i,b=v?function(t){return p[t]}:function(){return p};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(a=0;a1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=v[d],m=v[p],y=c?c/.8+1:0,b=-m*y-.5*m;o.offset[a]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":352,"../../components/fx/helpers":366,"../../constants/interactions":435,"../../lib":458,"../../lib/gl_format_color":455,"../../plots/cartesian/axis_ids":508,"../../registry":551,"../scatter/make_bubble_size_func":630,"../scatter/subtypes":637,"./constants":643,"./helpers":648,"color-normalize":61,"fast-isnumeric":152,"svg-path-sdf":282}],645:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),u=t("../scatter/xy_defaults"),c=t("../scatter/marker_defaults"),f=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,p){function g(r,a){return n.coerce(t,e,o,r,a)}var v=!!t.marker&&i.isOpenSymbol(t.marker.symbol),m=l.isBubble(t),y=u(t,e,p,g);if(y){var b=y100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":643}],649:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=a.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=a.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=a.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.mc=a.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=a.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var k=a.extendFlat({},t,{color:i(o,h),x0:m-b,x1:m+b,xLabelVal:h.x,y0:y-b,y1:y+b,yLabelVal:h.y,cd:A,distance:u,spikeDistance:c,hovertemplate:h.ht});return h.htx?k.text=h.htx:h.tx?k.text=h.tx:o.text&&(k.text=o.text),a.fillText(h,o,k),n.getComponentMethod("errorbars","hoverInfo")(h,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,f,h,d,p=t.cd,g=p[0].t,v=p[0].trace,m=t.xa,y=t.ya,b=g.x,x=g.y,_=m.c2p(e),w=y.c2p(r),A=t.distance;if(g.tree){var k=m.p2c(_-A),T=m.p2c(_+A),M=y.p2c(w-A),E=y.p2c(w+A);a="x"===n?g.tree.range(Math.min(k,T),Math.min(y._rl[0],y._rl[1]),Math.max(k,T),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(k,T),Math.min(M,E),Math.max(k,T),Math.max(M,E))}else a=g.ids;var S=A;if("x"===n)for(u=0;u-1;u--)s=b[a[u]],l=x[a[u]],c=m.c2p(s)-_,f=y.c2p(l)-w,(h=Math.sqrt(c*c+f*f))m.glText.length){var w=x-m.glText.length;for(p=0;pr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var k=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(k)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,x),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,h,d=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],a=0,i=0;i-1;for(p=0;ph?2*(x.sizeAvg||Math.max(x.size,3)):i(e,b),d=0;di&&l||a-1,M=!0;if(o(b)||!!d.selectedpoints||T){var E=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var S=d.selectedpoints,C={};for(l=0;l 0) { var factor = 1 - 2 * frameMargins; @@ -120575,7 +120584,7 @@ module.exports = { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[4])(4) }); diff --git a/dist/plotly-gl3d.min.js b/dist/plotly-gl3d.min.js index 44d54c03b8d..00b2215a11b 100644 --- a/dist/plotly-gl3d.min.js +++ b/dist/plotly-gl3d.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (gl3d - minified) v1.54.2 +* plotly.js (gl3d - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -46,4 +46,4 @@ var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t(" * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||"undefined"==typeof n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],317:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],318:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(l(t)),")};return robustDeterminant",t].join(""))(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length<6;)f.push(c(f.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);for(e.exports=i.apply(void 0,f.concat([f,c])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var a=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;a.length<6;)a.push(i(a.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,a.concat([a,i])),n=0;n<6;++n)e.exports[n]=a[n]}()},{"robust-determinant":319}],323:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],d=r[2]-n[2],p=a*u,g=o*l,v=o*s,m=i*u,y=i*l,b=a*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++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;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],330:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":39,"reduce-simplicial-complex":315}],331:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,"undefined"==typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=A[0];return v(0,k-1),k-=1,b(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((k+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}var A=[],T=new Array(a);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;M(E)}var L=[];for(f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":323,"simplicial-complex":335}],338:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},{"./lib/order-segments":338,"binary-search-bounds":339,"functional-red-black-tree":93,"robust-orientation":323}],341:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":320,"robust-sum":328}],342:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+i).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+i+l:"0"===u?h+l+i:l+h+i)}return g}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],343:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;s c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var k=p[x].length/y*.5,E=.5+m[x]/y*.5;A.push("d"+x+"-"+E+"-"+k+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var L=[];for(u=0;u<1<1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=S(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(I(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},L=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function D(t){return R(t)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!B.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],345:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=a;function i(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=i(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return i(e,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":292}],346:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],o=0;oMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var d=h.prototype;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[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])]},d.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,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);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,M=b,A=-v*b,T=-m*b,k=y,E=this.computedEye,L=this.computedMatrix;for(a=0;a<3;++a){var S=_*r[a]+w*h[a]+M*e[a];L[4*a+1]=A*r[a]+T*h[a]+k*e[a],L[4*a+2]=S,L[4*a+3]=0}var C=L[1],O=L[5],R=L[9],P=L[2],z=L[6],I=L[10],D=O*I-R*z,N=R*P-C*I,F=C*z-O*P,j=u(D,N,F);D/=j,N/=j,F/=j,L[0]=D,L[4]=N,L[8]=F;for(a=0;a<3;++a)E[a]=x[a]+L[2+4*a]*d;for(a=0;a<3;++a){c=0;for(var B=0;B<3;++B)c+=L[a+4*B]*E[B];L[12+a]=-c}L[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,p);for(u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=u(c-=a*d,f-=o*d,h-=s*d),g=(c/=p)*e+a*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=u(b-=s*w,x-=l*w,_-=f*w),A=l*(_/=M)-f*(x/=M),T=f*(b/=M)-s*_,k=s*x-l*b,E=u(A,T,k);if(A/=E,T/=E,k/=E,this.center.jump(t,q,G,X),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===a){var L=e[1],S=e[5],C=e[9],O=L*b+S*x+C*_,R=L*A+S*T+C*k;m=D<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,O)}else{var P=e[2],z=e[6],I=e[10],D=P*s+z*l+I*f,N=P*b+z*x+I*_,F=P*A+z*T+I*k;m=Math.asin(c(D)),y=Math.atan2(F,N)}this.angle.jump(t,y,m),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,X=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-j*W,G-B*W,X-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=i*g+a*v+o*m,b=u(g-=y*i,v-=y*a,m-=y*o);if(!(b<.01&&(b=u(g=a*h-o*f,v=o*l-i*h,m=i*f-a*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,i,a,o),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=a*m-o*v,_=o*g-i*m,w=i*v-a*g,M=u(x,_,w),A=i*l+a*f+o*h,T=g*l+v*f+m*h,k=(x/=M)*l+(_/=M)*f+(w/=M)*h,E=Math.asin(c(A)),L=Math.atan2(k,T),S=this.angle._state,C=S[S.length-1],O=S[S.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-L),P=Math.abs(C-L),z=Math.abs(C-2*Math.PI-L);R0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function M(t){return s?new BigUint64Array(d(8*t),0,t):null}function A(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return M(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=M,r.mallocBigInt64=A,r.mallocDataView=T,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":37,buffer:49,dup:86}],351:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",a="",o=i.length,s=a.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(i);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var i=c(t,n),a=function(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;l=0?e[a]:i}))},has___:{value:y((function(e){var n=m(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=m(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=m(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};p.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof p||b();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new p),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new p),i.set___(t,e)}else n.set(t,e);return this},Object.create(p.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=p.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=p)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function v(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function m(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function b(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],356:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":357}],357:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],358:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":356}],359:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":95}],360:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":77}],361:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":360}],362:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],363:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":542,"../../plots/cartesian/constants":558,"../../plots/font_attributes":580,"./arrow_paths":362}],364:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":506,"../../plots/cartesian/axes":552,"./draw":369}],365:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,G=["x","y"],X=0;X1)&&(tt===J?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(q=!0):q=!0),W=et._offset+et.r2p(e[$]),Q=.5}else"x"===$?(Z=e[$],W=x.l+x.w*Z):(Z=1-e[$],W=x.t+x.h*Z),Q=e.showarrow?.5:Z;if(e.showarrow){lt.head=W;var ct=e["a"+$];K=nt*U(.5,e.xanchor)-it*U(.5,e.yanchor),tt===J?(lt.tail=et._offset+et.r2p(ct),Y=K):(lt.tail=W+ct,Y=K+ct),lt.text=lt.tail+K;var ft=b["x"===$?"width":"height"];if("paper"===J&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),dt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):dt>0&&(lt.tail-=dt,lt.text-=dt)}lt.tail+=st,lt.head+=st}else Y=K=at*U(Q,ot),lt.text=W+K;lt.text+=st,K+=st,Y+=st,e["_"+$+"padplus"]=at/2+Y,e["_"+$+"padminus"]=at/2-Y,e["_"+$+"size"]=at,e["_"+$+"shift"]=K}if(q)P.remove();else{var pt=0,gt=0;if("left"!==e.align&&(pt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(R-y)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:D+pt-1,y:D+gt}).call(u.setClipUrl,F?k:null,t);else{var vt=D+gt-p.top,mt=D+pt-p.left;V.call(f.positionText,mt,vt).call(u.setClipUrl,F?k:null,t)}j.select("rect").call(u.setRect,D,D,w,R),N.call(u.setRect,z/2,z/2,I-z,B-z),P.call(u.setTranslate,Math.round(E.x.text-I/2),Math.round(E.y.text-B/2)),C.attr({transform:"rotate("+L+","+E.x.text+","+E.y.text+")"});var yt,bt=function(r,n){S.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,p=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,b=o.rotationXYMatrix(L,m,y),w=o.apply2DTransform(b),k=o.apply2DTransform2(b),O=+N.attr("width"),R=+N.attr("height"),z=m-.5*O,I=z+O,D=y-.5*R,F=D+R,j=[[z,D,z,F],[z,F,I,F],[I,F,I,D],[I,D,z,D]].map(k);if(!j.reduce((function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){j.forEach((function(t){var e=o.segmentsIntersect(h,p,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var B=e.arrowwidth,U=e.arrowcolor,V=e.arrowside,H=S.append("g").style({opacity:l.opacity(U)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+h+","+p+"L"+c+","+f).style("stroke-width",B+"px").call(l.stroke,l.rgb(U));if(g(q,V,e),_.annotationPosition&&q.node().parentNode&&!a){var G=c,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-p,2));G+=e.standoff*(h-c)/W,X+=e.standoff*(p-f)/W}var Y,Z,Q=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(p-X),transform:"translate("+G+","+X+")"}).style("stroke-width",B+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);Y=t.x,Z=t.y,s&&s.autorange&&M(s._name+".autorange",!0),v&&v.autorange&&M(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,Z),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),A("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),A("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&A("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&A("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),C.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&bt(0,0),O)d.init({element:P.node(),gd:t,prepFn:function(){yt=C.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?A("ax",s.p2r(s.r2p(e.ax)+t)):A("ax",e.ax+t),e.ayref===e.yref?A("ay",v.p2r(v.r2p(e.ay)+r)):A("ay",e.ay+r),bt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=d.align(u+t/x.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var c=e._ysize/x.h,f=e.y-(e._yshift+e.yshift)/x.h-c/2;o=d.align(f-r/x.h,c,0,1,e.yanchor)}A("x",i),A("y",o),s&&v||(n=d.getCursor(s?.5:i,v?.5:o,e.xanchor,e.yanchor))}C.attr({transform:"translate("+t+","+r+")"+yt}),h(P,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",H(n))},doneFn:function(){h(P),i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void O();if(m){if(m*m>b*b+x*x)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void O();var M=y*Math.cos(l),A=y*Math.sin(l);o.x-=M,o.y-=A,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),k="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":592,"../annotations/draw":369}],376:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));X*=Z*u.roundUp(Y/Z,[2,5,10]),(Math.abs(S.start)/S.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=X}G.domain=[V+j,V+D-j],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var Q,K=t.select("."+A.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+A.cbaxis),J=0;function tt(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+N)*l.w,n=G.title.font.size;t="top"===T?(1-(V+D-j))*l.h+l.t+3+.75*n:(1-(V+j))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var a=t.select("."+A.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=a.select(".h"+G._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*_),f?(J=h.bBox(f).height)>d&&(c[1]-=(J-d)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(J=h.bBox(o.node()).height),J){if(J+=5,"top"===T)G.domain[1]-=J/l.h,c[1]*=-1;else{G.domain[0]+=J/l.h;var p=g.lineCount(o);c[1]+=(1-p)*d}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).data(O);m.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),m.exit().remove();var y=k.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));m.each((function(t,a){var o=[0===a?k[0]:(O[a]+O[a-1])/2,a===O.length-1?k[1]:(O[a]+O[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:B,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(v.color&&v.width?R:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(t))+v.width/2%1)+"h"+P).call(h.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var x=B+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),M=s.makeTransFn(G),S=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:$,path:s.makeTickPath(G,x,S),transFn:M}),s.drawLabels(r,G,{vals:w,layer:$,transFn:M,labelFns:s.makeLabelFns(G,x)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=P+e.outlinewidth/2+h.bBox($.node()).width;if((Q=K.select("text")).node()&&!Q.classed(A.jsPlaceholder)){var i,o=K.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(K.node()).right-B-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-q;t.select("."+A.cbbg).attr({x:B-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-F,width:Math.max(s,2),height:Math.max(u+2*F,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:B,y:q+e.ypad+("top"===T?J:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-J,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},p=w[e.yanchor],g=M[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*p,f.b=u*g):(f.t=f.b=0,f.yt=e.y+e.len*p,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=M[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*m;else{var y=s-P;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}a.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);f(t,u)},doneFn:function(){if(f(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":480,"../../lib":506,"../../lib/extend":500,"../../lib/setcursor":525,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":552,"../../plots/cartesian/axis_defaults":554,"../../plots/cartesian/layout_attributes":566,"../../plots/cartesian/position_defaults":569,"../../plots/plots":597,"../../registry":606,"../color":378,"../colorscale/helpers":389,"../dragelement":397,"../drawing":400,"../titles":473,"./constants":380,d3:81,tinycolor2:344}],383:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":506}],384:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":379,"./defaults":381,"./draw":382,"./has_colorbar":383}],385:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var d=s+"auto",p=s+"min",g=s+"max",v=s+"mid",m=(o(h+d),o(h+p),o(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":521,"../colorbar/attributes":379,"./scales.js":393}],386:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,f=a(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":506,"./helpers":389,"fast-isnumeric":90}],387:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],395:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":506}],396:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],397:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":506,"../../plots/cartesian/constants":558,"./align":394,"./cursor":395,"./unhover":398,"has-hover":248,"has-passive-events":249,"mouse-event-offset":271}],398:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":498,"../../lib/events":499,"../../lib/throttle":530,"../fx/constants":412}],399:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],400:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,m=e.exports={};m.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);m.translatePoint(t,i,e,r)}))},m.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){m.hideOutsideRangePoint(t,n.select(this),r,i,s,l)}))}))}},m.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(m.dashLine,l,o)}))},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;m.symbolList.push(r,t,r+100,t+"-open"),m.symbolNames[r]=t,m.symbolFuncs[r]=e.f,e.needLine&&(m.symbolNeedLines[r]=!0),e.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(m.symbolNoFill[r]=!0)}));var b=m.symbolNames.length;function x(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.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=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},M=n.format("~.1f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=A[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},m.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},m.pointStyle=function(t,e,r){if(t.size()){var i=m.makePointStyleFns(e);t.each((function(t){m.singlePointStyle(t,n.select(this),e,i,r)}))}},m.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=m.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so)d=o.outlierwidth,h=o.outliercolor,f=a.outliercolor;else{var g=(o||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=a.gradient,y=t.mgt;if(y?p=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],A[y]||(y=0)),y&&"none"!==y){var b=t.mgc;b?p=!0:b=v.color;var _=r.uid;p&&(_+="-"+t.i),m.gradient(e,i,_,y,[[0,b],[1,f]],"fill")}else s.fill(e,f);d&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=i.color,v=a.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=i.size,b=a.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(m.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=m.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var f=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};v(h,e,t.i);var d=e._meta||{};l=u.texttemplateString(l,f,s._d3locale,h,t,d)}var p=t.tp||e.textposition,g=E(t,e),y=i?i(t):t.tc||e.textfont.color;a.call(m.font,t.tf||e.textfont.family,g,y).text(l).call(c.convertToTspans,r).call(k,p,g,t.mrc)}else a.remove()}))}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=E(t,e);s.fill(i,a),k(i,o,l,t.mrc2||t.mrc)}))}};function L(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,u.extendFlat({},v)},m.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},m.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},m.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var z=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":414,"../../constants/alignment":480,"../../constants/interactions":484,"../../constants/xmlns_namespaces":486,"../../lib":506,"../../lib/svg_text_utils":529,"../../registry":606,"../../traces/scatter/make_bubble_size_func":652,"../../traces/scatter/subtypes":659,"../color":378,"../colorscale":390,"./symbol_defs":401,d3:81,"fast-isnumeric":90,tinycolor2:344}],401:[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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:81}],402:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],403:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(a+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":659,"../drawing":400,d3:81,"fast-isnumeric":90}],408:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":378,d3:81}],409:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":500,"../../plots/font_attributes":580,"./layout_attributes":419}],410:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=J+x[0]._offset,e.pointerY=tt+w[0]._offset,z="xval"in e?g.flat(l,e.xval):g.p2c(x,J),I="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!i(z[0])||!i(I[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(N=0;NX&&(Z.splice(0,X),rt=Z[0].distance),m&&0!==Y&&0===Z.length){G.distance=Y,G.index=!1;var h=j._module.hoverPoints(G,H,q,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=Y}))),h&&h.length){var d,p=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];i(v.x0)&&i(v.y0)&&(d=at(v),(!K.vLinePoint||K.vLinePoint.spikeDistance>d.spikeDistance)&&(K.vLinePoint=d))}var y=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];i(b.x0)&&i(b.y0)&&(d=at(b),(!K.hLinePoint||K.hLinePoint.spikeDistance>d.spikeDistance)&&(K.hLinePoint=d))}}}}}function it(t,e){for(var r,n=null,i=1/0,a=0;a1||Z.length>1)||"closest"===S&&$&&Z.length>1,Tt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),kt={hovermode:S,rotateLabels:At,bgColor:Tt,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Et=L(Z,kt,t);g.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?_:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(a=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var w=x[s],M=w.datum;M.offset=w.dp,M.del=w.del}}}(Et,At?"xa":"ya",c),C(Et,At));if(e.target&&e.target.tagName){var Lt=p.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),Lt?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,bt))return;bt&&t.emit("plotly_unhover",{event:e,points:bt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:z,yvals:I})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map((function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o},l=L(i,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function L(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},x=e.fontFamily||v.HOVERFONT,_=e.fontSize||v.HOVERFONTSIZE,w=t[0],M=w.xa,E=w.ya,L="y"===a.charAt(0)?"yLabel":"xLabel",C=w[L],O=(String(C)||"").split(" ")[0],R=d.node().getBoundingClientRect(),P=R.top,z=R.width,I=R.height,D=void 0!==C&&w.distance<=e.hoverdistance&&("x"===a||"y"===a);if(D){var N,F,j=!0;for(N=0;Ni.width-L?(m=i.width-L,s.attr("d","M"+(L-A)+",0L"+L+","+k+A+"v"+k+(2*T+b.height)+"H-"+L+"V"+k+A+"H"+(L-2*A)+"Z")):s.attr("d","M0,0L"+A+","+k+A+"H"+(T+b.width/2)+"v"+k+(2*T+b.height)+"H-"+(T+b.width/2)+"V"+k+A+"H-"+A+"Z")}else{var S,O,R;"right"===E.side?(S="start",O=1,R="",m=M._offset+M._length):(S="end",O=-1,R="-",m=M._offset),y=E._offset+(w.y0+w.y1)/2,u.attr("text-anchor",S),s.attr("d","M0,0L"+R+A+","+A+"V"+(T+b.height/2)+"h"+R+(2*T+b.width)+"V-"+(T+b.height/2)+"H"+R+A+"V-"+A+"Z");var z,I=b.height/2,D=P-b.top-I,N="clip"+i._uid+"commonlabel"+E._id;if(m=0?J-=rt:J+=2*T;var nt=et.height+2*T,it=$+nt>=I;return nt<=I&&($<=P?$=E._offset+2*T:it&&($=I-nt)),tt.attr("transform","translate("+J+","+$+")"),tt}var at=h.selectAll("g.hovertext").data(t,(function(t){return k(t)}));return at.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,_)})),at.exit().remove(),at.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=f.combine(f.opacity(o)?o:f.defaultLine,u),d=f.combine(f.opacity(t.color)?t.color:f.defaultLine,u),p=t.borderColor||f.contrast(h),g=S(t,D,a,i,C,e),v=g[0],m=g[1],y=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||_,t.fontColor||p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),M=0,k=0;if(m&&m!==v){w.call(c.font,t.fontFamily||x,t.fontSize||_,d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var E=w.node().getBoundingClientRect();M=E.width+2*T,k=E.height+2*T}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:p});var L,O,R=y.node().getBoundingClientRect(),N=t.xa._offset+(t.x0+t.x1)/2,F=t.ya._offset+(t.y0+t.y1)/2,j=Math.abs(t.x1-t.x0),B=Math.abs(t.y1-t.y0),U=R.width+A+T+M;if(t.ty0=P-R.top,t.bx=R.width+2*T,t.by=Math.max(R.height+2*T,k),t.anchor="start",t.txwidth=R.width,t.tx2width=M,t.offset=0,s)t.pos=N,L=F+B/2+U<=I,O=F-B/2-U>=0,"top"!==t.idealAlign&&L||!O?L?(F+=B/2,t.anchor="start"):t.anchor="middle":(F-=B/2,t.anchor="end");else if(t.pos=F,L=N+j/2+U<=z,O=N-j/2-U>=0,"left"!==t.idealAlign&&L||!O)if(L)N+=j/2,t.anchor="start";else{t.anchor="middle";var V=U/2,H=N+V-z,q=N-V;H>0&&(N-=H),q<0&&(N+=-q)}else N-=j/2,t.anchor="end";y.attr("text-anchor",t.anchor),M&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+N+","+F+")"+(s?"rotate("+b+")":""))})),at}function S(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=z(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===i?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,f=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,f,u,h,t.trace._meta)).replace(E,(function(e,r){return s=z(r,t.nameLength),""}))),[l,s]}function C(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(A+T),f=u+s*(t.txwidth+T),h=0,d=t.offset;"middle"===a&&(u-=t.tx2width/2,f+=t.txwidth/2+T),e&&(d*=-M,h=t.offset*w),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*A+h)+","+(A+d)+"v"+(t.by/2-A)+"h"+o*t.bx+"v-"+t.by+"H"+(o*A+h)+"V"+(d-A)+"Z");var p=u+h,g=d+t.ty0-t.by/2+T,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==a?(i.attr("text-anchor","start"),p="middle"===a?-t.bx/2-t.tx2width/2+T:-t.bx-T):"right"===v&&"end"!==a&&(i.attr("text-anchor","end"),p="middle"===a?t.bx/2-t.tx2width/2-T:t.bx+T)),i.call(l.positionText,p,g),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*T+h,d+t.ty0-t.by/2+T),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,d-t.by/2-1,t.tx2width,t.by+2))}))}function O(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||h){var g=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,g)<1.5?f.contrast(g):y.color,w=i.spikemode,M=i.spikethickness,A=i.spikecolor||_,T=d.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var k=i._counterDomainMin,E=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),E=Math.max(E,i.position)),b=l.l+k*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:A,"stroke-dasharray":c.dashStyle(i.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?M:-M),cy:m,r:M,fill:A}).classed("spikeline",!0)}if(p){var L,S,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(L=u.pointerX,S=u.pointerY):(L=n._offset+C.x,S=i._offset+C.y);var O,R,P=a.readability(C.color,g)<1.5?f.contrast(g):C.color,z=n.spikemode,I=n.spikethickness,D=n.spikecolor||P,N=d.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(O=N,R=S),-1!==z.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=l.t+(1-j)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:O,y2:R,"stroke-width":I,stroke:D,"stroke-dasharray":c.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:O,y2:R,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:N-("top"!==n.side?I:-I),r:I,fill:D}).classed("spikeline",!0)}}}function P(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function z(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":506,"../../lib/events":499,"../../lib/override_cursor":517,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":552,"../../registry":606,"../color":378,"../dragelement":397,"../drawing":400,"../legend/defaults":430,"../legend/draw":431,"./constants":412,"./helpers":414,d3:81,"fast-isnumeric":90,tinycolor2:344}],416:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":506,"../color":378,"./helpers":414}],417:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}var o,s=a("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!d&&!p)"independent"===A("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===A("roworder"),w=h?.2:.1,M=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",A,w,b,y),y:c("y",A,M,x,m,_)}}else delete e.grid}function A(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=a.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),i.coerceFont(_,"font",e.font);var m,y,b,x=_("orientation");"h"===x?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),_("traceorder",h),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",b),_("valign"),i.noneOrAll(u,v,["x","y"]),_("title.text")&&(_("title.side","h"===x?"left":"top"),i.coerceFont(_,"title.font",e.font))}}function _(t,e){return i.coerce(u,v,o,t,e)}}},{"../../lib":506,"../../plot_api/plot_template":542,"../../plots/layout_attributes":595,"../../registry":606,"./attributes":428,"./helpers":434}],431:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a=t.data()[0][0],s=a.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,p=r._maxNameLength;r.entries?n=a.text:(n=l?a.label:s.name,s._meta&&(n=i.templateString(n,s._meta)));var g=i.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?M(n,p):n),f.positionText(g,d.textGap,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(T,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(T,t,e,r);var s=a.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),f=u[u.length-1],h=i.keyedContainer(s,"transforms["+f+"].styles","target","value.name");h.set(a.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):T(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function T(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),a=i.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*g;if(a){var h=u.bBox(a);o=h.height,s=h.width,n?u.setTranslate(i,0,.25*o):u.setTranslate(i,l,.75*o+l)}else{var p=t.select(n?".legendtext":".legendtitletext"),v=f.lineCount(p),m=p.node();o=c*v,s=m?u.bBox(m).width:0;var y=c*((v-1)/2-.3);n?f.positionText(p,d.textGap,-y):f.positionText(p,d.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function k(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function E(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,f="legend"+s._uid;if(e?(r=e.layer,f+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;h=y(e.entries,e)}var p=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+f).remove(),a.autoMargin(t,"legend");var g=i.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),M=i.ensureSingleById(s._topdefs,"clipPath",f,(function(t){t.append("rect")})),L=i.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var S=i.ensureSingle(g,"g","scrollbox"),C=e.title;if(e._titleWidth=0,e._titleHeight=0,C.text){var O=i.ensureSingle(S,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,C.font).text(C.text),T(O,S,t,e)}else S.selectAll(".legendtitletext").remove();var R=i.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),P=S.selectAll("g.groups").data(h);P.enter().append("g").attr("class","groups"),P.exit().remove();var z=P.selectAll("g.traces").data(i.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){e._main&&n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),c=i.borderwidth,f=2*c,h=d.textGap,p=d.itemGap,g=2*(c+p),v=E(i),m=i.y<0||0===i.y&&"top"===v,y=i.y>1||1===i.y&&"bottom"===v;i._maxHeight=Math.max(m||y?a.height/2:o.h,30);var b=0;i._width=0,i._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+_[0],c+_[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),b=h+i._width,i._width+=p+h+f,i._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=k(i),M=i.x<0||0===i.x&&"right"===w,A=i.x>1||1===i.x&&"left"===w,T=y||m,L=a.width/2;i._maxWidth=Math.max(M?T&&"left"===w?o.l+o.w:L:A?T&&"right"===w?o.r+o.w:L:o.w,2*h);var S=0,C=0;r.each((function(t){var e=t[0].width+h;S=Math.max(S,e),C+=e})),b=null;var O=0;if(l){var R=0,P=0,z=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,_[0],_[1]+c+p+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),R=Math.max(R,e);var r=t+p;r+c+P>i._maxWidth&&(O=Math.max(O,P),P=0,z+=R+i.tracegroupgap,R=e),u.setTranslate(this,P,z),P+=r})),i._width=Math.max(O,P)+c,i._height=z+R+g}else{var I=r.size(),D=C+f+(I-1)*pi._maxWidth&&(O=Math.max(O,B),F=0,j+=N,i._height+=N,N=0),u.setTranslate(this,_[0]+c+F,_[1]+c+j+e/2+p),B=F+r+p,F+=n,N=Math.max(N,e)})),D?(i._width=F+f,i._height=N+g):(i._width=Math.max(O,B)+f,i._height+=N+g)}}i._width=Math.ceil(Math.max(i._width+_[0],i._titleWidth+2*(c+d.titlePad))),i._height=Math.ceil(Math.max(i._height+_[1],i._titleHeight+2*(c+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var U=t._context.edits,V=U.legendText||U.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?h:b||h+t[0].width;s||(i+=p/2),u.setRect(e,0,-r/2,i,r)}))}(t,P,z,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=k(e),n=E(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var c,h,p,y,b=s._size,x=e.borderwidth,w=b.l+b.w*e.x-v[k(e)]*e._width,A=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var T=w,C=A;w=i.constrain(w,0,s.width-e._width),A=i.constrain(A,0,s.height-e._effHeight),w!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==C&&i.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(g,w,A),R.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var O=e._effHeight;e._main||(O=e._height),L.attr({width:e._width-x,height:O-x,x:x/2,y:x/2}),u.setTranslate(S,0,0),M.select("rect").attr({width:e._width-2*x,height:O-2*x,x:x,y:x}),u.setClipUrl(S,f,t),u.setRect(R,0,0,0,0),delete e._scrollY}else{var P,z,I,D=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-D-2*d.scrollBarMargin,F=e._height-e._effHeight,j=N/F,B=Math.min(e._scrollY||0,F);L.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),M.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+B}),u.setClipUrl(S,f,t),H(B,D,j),g.on("wheel",(function(){H(B=i.constrain(e._scrollY+n.event.deltaY/N*F,0,F),D,j),0!==B&&B!==F&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=B})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(z="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(B=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,F)}(I,P,z),D,j))}));R.call(U);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,I=B)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(z=t.changedTouches[0].clientY,H(B=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,F)}(I,P,z),D,j))}));S.call(V)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=u.getTranslate(g);p=t.x,y=t.y},moveFn:function(t,r){var n=p+t,i=y+r;u.setTranslate(g,n,i),c=l.align(n,0,b.l,b.l+b.w,e.xanchor),h=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&_(t,g,i,e,n)}})}function H(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(S,0,-r),u.setRect(R,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),M.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":480,"../../lib":506,"../../lib/events":499,"../../lib/svg_text_utils":529,"../../plots/plots":597,"../../registry":606,"../color":378,"../dragelement":397,"../drawing":400,"./constants":429,"./get_legend_data":432,"./handle_click":433,"./helpers":434,"./style":436,d3:81}],432:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,f=0,h=e._main;function d(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return p?n:Math.min(i,r)};function v(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],i=g(r.mlw,o.line,5,2);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)}))}function m(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,d=g(f(h.width,o.pts),h,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=h.color;var v=a.minExtend(o,{trace:p});c(u,v,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));i.attr("transform","translate(0,"+u+")")}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=i.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,u=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,f=n.select(this),d=l(i),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;c=0===u?p[g?v-1:0][1]:1===u?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(m)?m[u]||m[0]:m}f.attr("d",t[0]),c?f.call(s.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;o.gradient(t,e,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,v(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=g(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)}))})).each((function(t){v(t,this,"funnel")})).each((function(t){v(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=g(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:p?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){m(t,this,"funnelarea")})).each((function(t){m(t,this,"pie")})).each((function(t){var r,i,s=t[0],c=s.trace,f=c.visible&&c.fill&&"none"!==c.fill,d=u.hasLines(c),p=c.contours,v=!1,m=!1,y=l(c),b=y.colorscale,x=y.reversescale;if(p){var _=p.coloring;"lines"===_?v=!0:d="none"===_||"heatmap"===_||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=u.hasMarkers(c)||u.hasText(c),M=f||m,A=d||v,T=w||!M?"M5,0":A?"M5,-2":"M5,-3",k=n.select(this),E=k.select(".legendfill").selectAll("path").data(f||m?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),b,"fill")}}),d||v){var L=g(void 0,c.line,10,5);i=a.minExtend(c,{line:{width:L}}),r=[a.minExtend(s,{trace:i})]}var S=k.select(".legendlines").selectAll("path").data(d||v?[r]:[]);S.enter().append("path").classed("js-line",!0),S.exit().remove(),S.attr("d",T+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),b,"stroke")}})})).each((function(t){var r,i,s=t[0],l=s.trace,c=u.hasMarkers(l),f=u.hasText(l),h=u.hasLines(l);function d(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(p&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||f||h){var v={},m={};if(c){v.mc=d("marker.color",g),v.mx=d("marker.symbol",g),v.mo=d("marker.opacity",a.mean,[.2,1]),v.mlc=d("marker.line.color",g),v.mlw=d("marker.line.width",a.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=d("marker.size",a.mean,[2,16],12);v.ms=y,m.marker.size=y}h&&(m.line={width:d("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=d("textposition",g),v.ts=10,v.tc=d("textfont.color",g),v.tf=d("textfont.family",g)),r=[a.minExtend(s,v)],(i=a.minExtend(l,m)).selectedpoints=null,i.texttemplate=null}var b=n.select(this).select("g.legendpoints"),x=b.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var _=b.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=g(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=g(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}},{"../../lib":506,"../../registry":606,"../../traces/pie/helpers":632,"../../traces/pie/style_one":633,"../../traces/scatter/subtypes":659,"../color":378,"../colorscale/helpers":389,"../drawing":400,d3:81}],437:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(L=["toggleHover"],S=["resetViews"]):p?(E=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],S=["resetGeo"]):d?(L=["hoverClosest3d"],S=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(E=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],S=["resetViewMapbox"]):m?L=["hoverClosestGl2d"]:g?L=["hoverClosestPie"]:_?(L=["hoverClosestCartesian","hoverCompareCartesian"],S=["resetViewSankey"]):L=["toggleHover"];h&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=D[r+1];else if(t=n.pmax)e=D[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(A=f,L="y0",T=y,S="y1"):(A=y,L="y1",T=f,S="y0");W(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===P?Y:Z,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),K(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;K(s)}};function W(r){if(m(t))P=null;else if(D)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),P=l.split("-")[0]}}function Y(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?F("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},B&&"date"===B.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else z?F("xanchor",r.xanchor=H(b+n)):(F("x0",r.x0=H(u+n)),F("x1",r.x1=H(v+n))),I?F("yanchor",r.yanchor=q(M+i)):(F("y0",r.y0=q(f+i)),F("y1",r.y1=q(y+i)));e.attr("d",_(t,r)),Q(s,r)}function Z(n,i){if(N){var a=function(t){return t},o=a,l=a;z?F("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},B&&"date"===B.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(D){if("resize-over-start-point"===P){var c=u+n,h=I?f-i:f+i;F("x0",r.x0=z?c:H(c)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===P){var d=v+n,p=I?y-i:y+i;F("x1",r.x1=z?d:H(d)),F("y1",r.y1=I?p:q(p))}}else{var m=function(t){return-1!==P.indexOf(t)},x=m("n"),G=m("s"),X=m("w"),W=m("e"),Y=x?A+i:A,Z=G?T+i:T,K=X?k+n:k,$=W?E+n:E;I&&(x&&(Y=A-i),G&&(Z=T-i)),(!I&&Z-Y>10||I&&Y-Z>10)&&(F(L,r[L]=I?Y:q(Y)),F(S,r[S]=I?Z:q(Z))),$-K>10&&(F(C,r[C]=z?K:H(K)),F(O,r[O]=z?$:H($)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(z||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=U(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=V(I?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),z&&I){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function K(t){t.selectAll(".visual-cue").remove()}h.init(X),G.node().onmousemove=W}(t,z,l,e,r,P):!0===l.editable&&z.style("pointer-events",O||u.opacity(E)*k<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,v(t)}}(t,z)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=a.getFromId(t,e.xref),v=a.getFromId(t,e.yref),m=t._fullLayout._size;if(d?(r=g.shapePositionToRange(d),n=function(t){return d._offset+d.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=g.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===h)return d&&"date"===d.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,f=b-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,_=(c+f)/2,w=Math.abs(x-l),M=Math.abs(_-c),A="A"+w+","+M,T=x+w+","+_;return"M"+T+A+" 0 1,1 "+(x+","+(_-M))+A+" 0 0,1 "+T+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),T&&!h)&&(A=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===M&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function R(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function S(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,v);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||f<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform","translate("+v+")")}}}return z.call(I),R&&(E?z.on(".opacity",null):(A=0,T=!0,z.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),z.classed("js-placeholder",T),w}}},{"../../constants/alignment":480,"../../constants/interactions":484,"../../lib":506,"../../lib/svg_text_utils":529,"../../plots/plots":597,"../../registry":606,"../color":378,"../drawing":400,d3:81,"fast-isnumeric":90}],474:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":500,"../../plot_api/edit_types":535,"../../plot_api/plot_template":542,"../../plots/font_attributes":580,"../../plots/pad_attributes":596,"../color/attributes":377}],475:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],476:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":506,"../../plots/array_container_defaults":548,"./attributes":474,"./constants":475}],477:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(E,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(M,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},A={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(_,o)}))})),c.call(_,o),b?(A.w=Math.max(m.openWidth,m.headerWidth),A.h=x.y-A.t):(A.w=x.x-A.l,A.h=Math.max(m.openHeight,m.headerHeight)),A.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,d=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,E=p,L=v+m;L+k>u&&(L=u-k);var S=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),A?(this.hbar=S.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:L,width:T,height:k}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,P=p+g,z=v;P+O>l&&(P=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:z,width:O,height:R}),this._vbarYMin=z+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var D=this.id,N=c-.5,F=C?f+O+.5:f+.5,j=h-.5,B=A?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+D).data(A||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",D).append("rect"),A||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(a.setClipUrl,D,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),A||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":506,"../color":378,"../drawing":400,d3:81}],480:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],481:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],482:[function(t,e,r){"use strict";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]}},{}],483:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],484:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],485:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],486:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],487:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],490:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],491:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":513}],492:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),M=t.match(w?b:y);if(!M)return c;var A=M[1],T=M[3]||"1",k=Number(M[5]||1),E=Number(M[7]||0),L=Number(M[9]||0),S=Number(M[11]||0);if(u){if(2===A.length)return c;var C;A=Number(A);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===T.charAt(T.length-1);T=parseInt(T,10),C=O.newDate(A,O.toMonthIndex(A,T,R),k)}else C=O.newDate(A,Number(T),k)}catch(t){return c}return C?(C.toJD()-g)*f+E*h+L*d+S*p:c}A=2===A.length?(Number(A)+2e3-x)%100+x:Number(A),T-=1;var P=new Date(Date.UTC(2e3,T,k,E,L));return P.setUTCFullYear(A),P.getUTCMonth()!==T||P.getUTCDate()!==k?c:P.getTime()+S*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*f,A=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,L=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function L(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var S=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),S[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var C=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+C);return u.setUTCMonth(u.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,d=u-a,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,i-t,a-e),l(c,f,p,o-t,u-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":513}],504:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=a(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=a(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=v?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;xo?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var S=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var i;return S.test(n)?i=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,i=r[n]()),l.isValidTextValue(i)?i:""}))};var C={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return P.apply(C,arguments)};var O={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return P.apply(O,arguments)};var R=/^[:|\|]/;function P(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,f,h,d;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var z=2e9;l.seedPseudoRandom=function(){z=2e9},l.pseudoRandom=function(){var t=z;return z=(69069*z+1)%4294967296,Math.abs(z-t)<429496729?l.pseudoRandom():z/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(i-u*(r+o))+","+(a-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":485,"./anchor_utils":490,"./angles":491,"./array":492,"./clean_number":493,"./clear_responsive":495,"./coerce":496,"./dates":497,"./dom":498,"./extend":500,"./filter_unique":501,"./filter_visible":502,"./geometry2d":503,"./identity":505,"./is_plain_object":507,"./keyed_container":508,"./localize":509,"./loggers":510,"./make_trace_groups":511,"./matrix":512,"./mod":513,"./nested_property":514,"./noop":515,"./notifier":516,"./push_unique":519,"./regex":521,"./relative_attr":522,"./relink_private":523,"./search":524,"./stats":527,"./throttle":530,"./to_log_range":531,d3:81,"fast-isnumeric":90}],507:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],508:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":540,"./notifier":516}],511:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{d3:81}],512:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],514:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;la||u===i||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":485,"./matrix":512}],519:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},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;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":492,"fast-isnumeric":90}],528:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":62}],529:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,T){var k=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&k.match(l),S=n.select(t.node().parentNode);if(!S.empty()){var C=t.attr("class")?t.attr("class").split(" ")[0]:"text";return C+="-math",S.selectAll("svg."+C).remove(),S.selectAll("g."+C+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(L[2],a,(function(n,i,a){S.selectAll("svg."+C).remove(),S.selectAll("g."+C+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void e();var l=S.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:C,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||s(t,"height"))/4;"y"===C[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===C[0]?o.attr({x:t.attr("x"),y:p-h/2}):"a"===C[0]&&0!==C.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-h/2}),T&&T.call(t,l),e(l)}))}))):O(),t}function O(){S.empty()||(C=t.attr("class")+"-math",S.select("svg."+C).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}y.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(v),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,p-i)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},k=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(k,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):T[e])||t}))}function L(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}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],531:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":90}],532:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],533:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],534:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,M,A,T,k,E=Object.keys(r).map(Number).sort(o),L=e.get(),S=L||[],C=c(m,f).get(),O=[],R=-1,P=S.length;for(b=0;bS.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==A)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(A)?O.push(_):T?("add"===A&&(A={}),S.splice(_,0,A),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,A),-1===R&&(R=_);else for(x=0;x=0;b--)S.splice(O[b],1),C&&C.splice(O[b],1);if(S.length?L||e.set(S):e.set(null),g)return!1;if(h(v,m),p!==i){var z;if(-1===R)z=E;else{for(P=Math.max(S.length,P),z=[],b=0;b=R);b++)z.push(_);for(b=R;b=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||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function z(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=R(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function H(t,e,r){if(t=o.getGraphDiv(t),M.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Z(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(A.layoutReplot):Object.keys(n).length&&(q(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(A.doLegend),a.layoutstyle&&s.push(A.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(A.doTicksRelayout),a.modebar&&s.push(A.doModeBar),a.camera&&s.push(A.doCamera),a.colorbars&&s.push(A.doColorBars),s.push(L)),s.push(h.rehover,h.redrag),u.add(t,H,[t,i.undoit],H,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function q(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,A.doAutoRangeAndConstraints,r,A.drawData,A.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=j(l._preGUI,u),d=Object.keys(e),g=p.list(t),v=o.extendDeepAll({},e),m={};for(V(e),d=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[I];)I--;var D=P.parts[I],N=P.parts[I-1]+"."+D,B=P.parts.slice(0,I).join("."),U=s(t.layout,B).get(),H=s(l,B).get(),q=P.get();if(void 0!==z){A[R]=z,E[R]="reverse"===D?z:F(q);var G=f.getLayoutValObject(l,P.parts);if(G&&G.impliedEdits&&null!==z)for(var Z in G.impliedEdits)L(o.relativeAttr(R,Z),G.impliedEdits[Z]);if(-1!==["width","height"].indexOf(R))if(z){L("autosize",null);var K="height"===R?"width":"height";L(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)L("width",z?null:l.width),L("height",z?null:l.height);else if(N.match(X))O(N),s(l,B+"._inputRange").set(null);else if(N.match(W)){O(N),s(l,B+"._inputRange").set(null);var $=s(l,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(Y)&&s(l,B+"._inputDomain").set(null);if("type"===D){var J=U,tt="linear"===H.type&&"log"===z,et="log"===H.type&&"linear"===z;if(tt||et){if(J&&J.range)if(H.autorange)tt&&(J.range=J.range[1]>J.range[0]?[1,2]:[2,1]);else{var rt=J.range[0],nt=J.range[1];tt?(rt<=0&&nt<=0&&L(B+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),L(B+".range[0]",Math.log(rt)/Math.LN10),L(B+".range[1]",Math.log(nt)/Math.LN10)):(L(B+".range[0]",Math.pow(10,rt)),L(B+".range[1]",Math.pow(10,nt)))}else L(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,z,L),c.getComponentMethod("images","convertCoords")(t,H,z,L)}else L(B+".autorange",!0),L(B+".range",null);s(l,B+"._inputRange").set(null)}else if(D.match(k)){var it=s(l,R).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,L),c.getComponentMethod("images","convertCoords")(t,it,at,L)}var ot=w.containerArrayMatch(R);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(z)?E[R]=null:w.isRemoveVal(z)?E[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,lt),m[r]||(m[r]={});var ut=m[r][n];ut||(ut=m[r][n]={}),ut[st]=z,delete e[R]}else"reverse"===D?(U.range?U.range.reverse():(L(B+".autorange",!0),U.range=[1,0]),H.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===z||"select"===z)&&"lasso"!==q&&"select"!==q||l._has("gl2d")?_.plot=!0:G?T.update(_,G):_.calc=!0,P.set(z))}}for(r in m){w.applyContainerArrayChanges(t,h(a,r),m[r],_,h)||(_.plot=!0)}var ct=l._axisConstraintGroups||[];for(S in C)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,M.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&AA)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&E<5&&(E++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===E&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,a];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(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&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(!(i=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return x(i,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":506,"../plots/attributes":549}],543:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return a.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var A=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=M(c,A,c.side),c._mainMirrorPosition=c.mirror&&A?M(c,A,d.OPPOSITE_SIDE[c.side]):null}var T=[],k=[],E=[],L=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(i in v._plots)if((s=v._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var S=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(S,C,E)){var R=O.node(),P=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(P.node(),R.childNodes[0]),k.push(i)}else O.select("rect.bg").remove(),E.push([S,C]),L||(T.push(i),k.push(i))}var z,I,D,N,F,j,B,U,V,H,q,G,X,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eM?c.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=g(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&v(a)&&t(a,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":506,"../plots/attributes":549,"../plots/plots":597,"./plot_config":540,"./plot_schema":541,"./plot_template":542}],545:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(A);function L(){return new Promise((function(t){setTimeout(t,s.getDelay(A._fullLayout))}))}function S(){return new Promise((function(t,e){var r=l(A,y,_),n=A._fullLayout.width,f=A._fullLayout.height;function h(){i.purge(A),document.body.removeChild(A)}if("full-json"===y){var d=a.graphJson(A,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.plot(A,r,T,k).then(E).then(L).then(S).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":506,"../plots/plots":597,"../snapshot/helpers":610,"../snapshot/svgtoimg":612,"../snapshot/tosvg":614,"../version":682,"./plot_api":539,"fast-isnumeric":90}],546:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var T,k,E,L,S,C=b.length,O=Array.isArray(A);if(O&&(C=Math.min(C,A.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var R=b[k].length;for(T=0;T<(O?Math.min(R,A[k].length):R);T++)E=O?A[k][T]:A,L=y[k][T],S=b[k][T],n.validate(L,E)?S!==L&&S!==+L&&i.push(p("dynamic",a,m.concat(k,T),L,S)):i.push(p("value",a,m.concat(k,T),L))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((x=T-o(v)-o(m))>k?_/x>L&&(y=v,b=m,L=_/x):_/T>L&&(y={val:v.val,pad:0},b={val:m.val,pad:0},L=_/T));if(h===d){var S=h-1,C=h+1;if(M)if(0===h)a=[0,1];else{var O=(h>0?f:c).reduce((function(t,e){return Math.max(t,o(e))}),0),R=h/(1-Math.min(.5,O/T));a=h>0?[0,R]:[R,0]}else a=A?[Math.max(0,S),Math.max(1,C)]:[S,C]}else M?(y.val>=0&&(y={val:0,pad:0}),b.val<=0&&(b={val:0,pad:0})):A&&(y.val-L*o(y)<0&&(y={val:0,pad:0}),b.val<=0&&(b={val:1,pad:0})),L=(b.val-y.val-E(v.val,m.val))/(T-o(y)-o(b)),a=[y.val-L*o(y),b.val+L*o(b)];return p&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function d(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,p,g,v,m=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,M=!1,A=r.vpadLinearized||!1;function T(t){if(Array.isArray(t))return M=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var k=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),S=T(r.vpadminus||r.vpad);if(!M){if(g=1/0,v=-1/0,w)for(i=0;i0&&(g=o),o>v&&o-a&&(g=o),o>v&&o=R;i--)O(i);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":485,"../../lib":506,"../../registry":606,"fast-isnumeric":90}],552:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),p=t("../../constants/numerical"),g=p.ONEAVGYEAR,v=p.ONEAVGMONTH,m=p.ONEDAY,y=p.ONEHOUR,b=p.ONEMIN,x=p.ONESEC,_=p.MINUS_SIGN,w=p.BADNUM,M=t("../../constants/alignment"),A=M.MID_SHIFT,T=M.CAP_SHIFT,k=M.LINE_SPACING,E=M.OPPOSITE_SIDE,L=e.exports={};L.setConvert=t("./set_convert");var S=t("./axis_autotype"),C=t("./axis_ids");L.id2name=C.id2name,L.name2id=C.name2id,L.cleanId=C.cleanId,L.list=C.list,L.listIds=C.listIds,L.getFromId=C.getFromId,L.getFromTrace=C.getFromTrace;var O=t("./autorange");L.getAutoRange=O.getAutoRange,L.findExtremes=O.findExtremes;function R(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}L.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},L.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=L.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},L.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:L.getFromId(e,r).cleanPos)(t)},L.redrawComponents=function(t,e){e=e||L.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},L.saveRangeInitial=function(t,e){for(var r=L.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=L.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=L.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=L.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,y,u,a)),v=b,0;v<=c;)v=L.tickIncrement(v,y,!1,a);return{start:e.c2r(b,0,a),end:e.c2r(v,0,a),size:y,_dataSpan:c-u}},L.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/i,L.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),q(t)},L.calcTicks=function(t,e){L.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=R(s.simpleMap(t.range,t.r2l)),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ca&&f=o:n<=o)&&!(u.length>r||n===e);n=L.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var i=!1;c&&n!==(0|n)&&(i=!0),u.push({minor:i,value:n})}}(),t.rangebreaks){var f=u.length;if(f){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var d,p=[],g=l?1:-1,v=l?f-1:0,m=l?0:f-1;g*m<=g*v;m+=g){var y=u[m];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var b=t.c2p(y.value);b===d?p[p.length-1].valueh)&&(d=b,p.push(y))}}u=p.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&a<=10||e>=15*m)t._tickround="d";else if(e>=b&&a<=16||e>=y)t._tickround="M";else if(e>=x&&a<=19||e>=b)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(W(t.exponentformat)&&!Y(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}L.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>g?(e/=g,r=n(10),t.dtick="M"+12*H(e,r,D)):a>v?(e/=v,t.dtick="M"+H(e,1,N)):a>m?(t.dtick=H(e,m,t._hasDayOfWeekBreaks?[1,2,7,14]:j),t.tick0=s.dateTick0(t.calendar,!0)):a>y?t.dtick=H(e,y,N):a>b?t.dtick=H(e,b,F):a>x?t.dtick=H(e,x,F):(r=n(10),t.dtick=H(e,r,D))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+H(e,r,D)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=H(e,r,V)):(t.tick0=0,r=n(10),t.dtick=H(e,r,D));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},L.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?U:B,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},L.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Z(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||W(d)&&Y(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":_)+h:(e.text=Z(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Z(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=Z(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=Z(e.x,t,i,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},L.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return L.hoverLabelText(t,e)+" - "+L.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=L.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+i:i};var X=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Y(t){return t>14||t<-15}function Z(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=L.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};q(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":W(l)&&(t+=X[u/3+5]));return a?_+t:t}function Q(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,f),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==h._dfltTitle[p]&&(n[l]+=$(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=f),!0===e.mirror||"ticks"===e.mirror?i[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Y&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,et(e),n),a.autoMargin(t,rt(e),i),a.autoMargin(t,nt(e),s)})),r.skipTitle||Y&&"bottom"===e.side||X.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+$(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,d=L.getPxPosition(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?d-r:d+r):(c=e._offset+e._length/2,l="right"===e.side?d+r:d-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(h={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var g=f.getTranslate(p.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(X)}}function Z(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=tt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},L.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},L.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},L.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},L.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,d,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(d="bottom"===t.side?1:-1,c=l*d,f=e+o*d,h="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+f+t.fontSize*h},p.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*d<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(d="right"===t.side?1:-1,c=o,f=-l*d,h=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*d},p.yFn=function(t){return t.dy+f+t.fontSize*A},p.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},L.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],K);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},L.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&L.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=i("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*b)||M)for(r=0;rP&&DO&&(O=D);d/=(O-C)/(2*R),C=u.l2r(C),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function F(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function j(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),B(t,e,i,a)}function B(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function U(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){C&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),C=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,S)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n){for(var i,a,o,l,u=!1,c={},f={},h=0;h=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(U(i),2!==t||pt||Ut(),dt)a.indexOf("select")>-1&&T(r,i,Z,Q,e.id,Lt),a.indexOf("event")>-1&&f.click(i,r,e.id);else if(1===t&&pt){var s=g?B:O,u="s"===g||"w"===C?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),d="left",p="middle";if(s.fixedrange)return;g?(p="n"===g?"top":"bottom","right"===s.side&&(d="right")):"e"===C&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(mt).call(l.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:p}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",i,c,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(J,e+yt)),i=Math.max(0,Math.min(tt,r+bt)),a=Math.abs(n-yt),o=Math.abs(i-bt);function s(){At="",xt.r=xt.l,xt.t=xt.b,kt.attr("d","M0,0Z")}if(xt.l=Math.min(yt,n),xt.r=Math.max(yt,n),xt.t=Math.min(bt,i),xt.b=Math.max(bt,i),et.isSubplotConstrained)a>S||o>S?(At="xy",a/J>o/tt?(o=a*tt/J,bt>i?xt.t=bt-o:xt.b=bt+o):(a=o*J/tt,yt>n?xt.l=yt-a:xt.r=yt+a),kt.attr("d",H(xt))):s();else if(rt.isSubplotConstrained)if(a>S||o>S){At="xy";var l=Math.min(xt.l/J,(tt-xt.b)/tt),u=Math.max(xt.r/J,(tt-xt.t)/tt);xt.l=l*J,xt.r=u*J,xt.b=(1-l)*tt,xt.t=(1-u)*tt,kt.attr("d",H(xt))}else s();else!it||og[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":506,"fast-isnumeric":90}],570:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":480}],571:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),M=t("../../plot_api/subroutines").redrawReglTraces,A=t("./constants"),T=A.MINSELECT,k=b.filter,E=b.tester,L=t("./handle_outline").clearSelect,S=t("./helpers"),C=S.p2r,O=S.axValue,R=S.getTransform;function P(t,e,r,n,i,a,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=m(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function j(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function U(t,e,r){var n,a,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!B){var r=Y.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&P(e,W,i.xaxes,i.yaxes,i.subplot,i,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},i.doneFn=function(){ft.remove(),x.done(ht).then((function(){x.clear(ht),i.gd.emit("plotly_selected",L),_&&i.selectionDefs&&(_.subtract=st,i.selectionDefs.push(_),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,b)),i.doneFnCompleted&&i.doneFnCompleted(dt)})).catch(y.error),B&&F(i)}},clearSelect:L,clearSelectionsCache:F,selectOnClick:P}},{"../../components/color":378,"../../components/dragelement/helpers":396,"../../components/drawing":400,"../../components/fx":418,"../../components/fx/helpers":414,"../../components/shapes/draw_newshape/display_outlines":463,"../../components/shapes/draw_newshape/helpers":464,"../../components/shapes/draw_newshape/newshapes":465,"../../lib":506,"../../lib/clear_gl_canvases":494,"../../lib/polygon":518,"../../lib/throttle":530,"../../plot_api/subroutines":543,"../../registry":606,"./axis_ids":555,"./constants":558,"./handle_outline":562,"./helpers":563,polybooljs:300}],572:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,b=t("./axis_ids"),x=t("./constants"),_=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function A(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function T(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*p*Math.abs(n-i))}return d}function k(e,r,n,o){var s=l(e,n||t.calendar);if(s===d){if(!i(e))return d;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function E(e,r,n){return s(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function S(e){if(A(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function C(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=C(t);return void 0!==e?e:i(t)?+t:void 0}function R(t,e,r){return n.round(r+e*t,2)}function P(t,e,r){return(t-r)/e}var z=function(e){return i(e)?R(e,t._m,t._b):d},I=function(e){return P(e,t._m,t._b)};if(t.rangebreaks){var D="y"===f;z=function(e){if(!i(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=D;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var f=t._B[s]||0;return isFinite(f)?R(e,t._m2,f):0},I=function(e){var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return P(e,t._m2,t._B[n])}}t.c2l="log"===t.type?T:u,t.l2c="log"===t.type?M:u,t.l2p=z,t.p2l=I,t.c2p="log"===t.type?function(t,e){return z(T(t,e))}:z,t.p2c="log"===t.type?function(t){return M(I(t))}:I,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=I,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return T(o(t),e)},t.r2d=t.r2c=function(t){return M(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=T,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(I(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=I,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=k,t.c2d=t.c2r=t.l2d=t.l2r=E,t.d2p=t.r2p=function(e,r,n){return t.l2p(k(e,0,n))},t.p2d=t.p2r=function(t,e,r){return E(I(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=S,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(I(t))},t.r2p=t.d2p,t.p2r=I,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=C,t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(I(t))},t.r2p=t.d2p,t.p2r=I,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=b.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),h="y"===f;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;si&&(i+=7,si&&(i+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),g=a.simpleMap(e.xr1,i.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),i.range[0]=i.l2r(p[0]*(1-r)+r*g[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?u/d[2]:1,M=h?c/d[3]:1,A=f?d[0]:0,T=h?d[1]:0,k=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,L=i._offset-k,S=l._offset-E;n.clipRect.call(o.setTranslate,A,T).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,S).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":400,"../../lib":506,"../../registry":606,"./axes":552,d3:81}],577:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var d=a(u),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":378,"../../../lib":506,"../../../registry":606,"../../get_data":582,"../../subplot_defaults":604,"./axis_defaults":586,"./layout_attributes":589}],589:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":506,"../../../lib/extend":500,"../../domain":579,"./axis_attributes":585}],590:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":528}],591:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c,{msUTC:!0}),p=0;p/g," "));l[u]=d,c.tickmode=f}}e.ticks=l;for(u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),b(e),e.glplot.axes.update(e.axesOptions);for(var s,l=Object.keys(e.traces),u=null,c=e.glplot.selection,p=0;p")):"isosurface"===t.type||"volume"===t.type?(w.valueLabel=h.tickText(e._mockAxis,e._mockAxis.d2l(c.traceCoordinate[3]),"hover").text,k.push("value: "+w.valueLabel),c.textLabel&&k.push(c.textLabel),y=k.join("
")):y=c.textLabel;var E={x:c.traceCoordinate[0],y:c.traceCoordinate[1],z:c.traceCoordinate[2],data:x._input,fullData:x,curveNumber:x.index,pointNumber:_};d.appendArrayPointValue(E,x,_),t._module.eventData&&(E=x._module.eventData(E,c,x,{},_));var L={points:[E]};e.fullSceneLayout.hovermode&&d.loneHover({trace:x,x:(.5+.5*m[0]/m[3])*a,y:(.5-.5*m[1]/m[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:y,name:u.name,color:d.castHoverOption(x,_,"bgcolor")||u.color,borderColor:d.castHoverOption(x,_,"bordercolor"),fontFamily:d.castHoverOption(x,_,"font.family"),fontSize:d.castHoverOption(x,_,"font.size"),fontColor:d.castHoverOption(x,_,"font.color"),nameLength:d.castHoverOption(x,_,"namelength"),textAlign:d.castHoverOption(x,_,"align"),hovertemplate:f.castOption(x,_,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,w),eventData:[E]},{container:n,gd:r}),c.buttons&&c.distance<5?r.emit("plotly_click",L):r.emit("plotly_hover",L),s=L}else d.loneUnhover(n),r.emit("plotly_unhover",s);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var M=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=M[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(c||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pv[1][a])v[0][a]=-1,v[1][a]=1;else{var S=v[1][a]-v[0][a];v[0][a]-=S/32,v[1][a]+=S/32}if("reversed"===s.autorange){var C=v[0][a];v[0][a]=v[1][a],v[1][a]=C}}else{var O=s.range;v[0][a]=s.r2l(O[0]),v[1][a]=s.r2l(O[1])}v[0][a]===v[1][a]&&(v[0][a]-=1,v[1][a]+=1),m[a]=v[1][a]-v[0][a],this.glplot.setBounds(a,{min:v[0][a]*h[a],max:v[1][a]*h[a]})}var R=u.aspectmode;if("cube"===R)g=[1,1,1];else if("manual"===R){var P=u.aspectratio;g=[P.x,P.y,P.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var I=y[l=(s=u[M[a]]).type];z[a]=Math.pow(I.acc,1/I.count)/h[a]}g="data"===R||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}u.aspectratio.x=c.aspectratio.x=g[0],u.aspectratio.y=c.aspectratio.y=g[1],u.aspectratio.z=c.aspectratio.z=g[2],this.glplot.setAspectratio(u.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=u.aspectmode);var D=u.domain||null,N=e._size||null;if(D&&N){var F=this.container.style;F.position="absolute",F.left=N.l+D.x[0]*N.w+"px",F.top=N.t+(1-D.y[1])*N.h+"px",F.width=N.w*(D.x[1]-D.x[0])+"px",F.height=N.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),u=this.isAspectChanged(t),h=l||u;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),u&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(u)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var u=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[u]=h;var p=n.layout;c.call("_storeDirectGUIEdit",p,i._preGUI,d),a.up=h,f.nestedProperty(p,u).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d"),u=l.createImageData(r,i);switch(u.data.set(a),l.putImageData(u,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[M[t]];h.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":418,"../../lib":506,"../../lib/show_no_webgl_msg":526,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":552,"../../registry":606,"./layout/convert":587,"./layout/spikes":590,"./layout/tick_marks":591,"./project":592,"gl-plot3d":142,"has-passive-events":249,"is-mobile":258,"webgl-context":359}],594:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a=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"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.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})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(f,s,c,i),y.cleanPlot(f,s,c,i);var F=!(!i._has||!i._has("gl2d")),j=!(!s._has||!s._has("gl2d")),B=!(!i._has||!i._has("cartesian"))||F,U=!(!s._has||!s._has("cartesian"))||j;B&&!U?i._bgLayer.remove():U&&!B&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&h({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=y.layoutAttributes.width.min,d=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:f,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),E(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,d=e.height,p=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in p)g[v]||delete p[v];for(var m in p.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},p){var b=p[m].l||{},x=p[m].b||{},_=b.val,w=b.size,M=x.val,A=x.size;for(var T in p){if(i(w)&&p[T].r){var k=p[T].r.val,L=p[T].r.size;if(k>_){var S=(w*k+(L-h)*_)/(k-_),C=(L*(1-_)+(w-h)*(1-k))/(k-_);S>=0&&C>=0&&h-(S+C)>0&&S+C>s+u&&(s=S,u=C)}}if(i(A)&&p[T].t){var O=p[T].t.val,R=p[T].t.size;if(O>M){var P=(A*O+(R-d)*M)/(O-M),z=(R*(1-M)+(A-d)*(1-O))/(O-M);P>=0&&z>=0&&d-(z+P)>0&&P+z>f+c&&(f=P,c=z)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(d)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return a.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return a.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(f.layout=c(s)),t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),u&&(f.frames=c(u)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,p[e]=a}}for(O(u,h,d),i=0;i=0?h.angularAxis.domain:n.extent(M),L=Math.abs(M[1]-M[0]);T&&!A&&(L=0);var S=E.slice();k&&A&&(S[1]+=L);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(S[1]-S[0])/C);var O=h.angularAxis.ticksStep||(S[1]-S[0])/(C*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var R=n.range.apply(this,S);if(R=R.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(S.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=k?L:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,D=t.select(".chart-group"),N={fill:"none",stroke:h.tickColor},F={"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){I=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var j=d.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:d.map((function(t,e){return t.name||"Element"+e})),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:I,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=I.node().getBBox();b=Math.min(h.width-B.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],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else I=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),D.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(F).text(h.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(N),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(N);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(N),q.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(F).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,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(R),Q=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),Q.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(N),Q.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(F);var K=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:a+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(F);h.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(D.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));I.attr({transform:"translate("+[b+$,h.margin.top]+")"});var J=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||J){var et=[];d.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.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 i(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});D.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});D.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(X).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};A&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)})),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).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},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return a.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)})),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a}))})),o=n.merge(a);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[a.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*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=i({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 a=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=i({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":480,"../../../lib":506,d3:81}],602:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":378,"../../../lib":506,"./micropolar":601,"./undo_manager":603,d3:81}],603:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":378,"../components/drawing":400,"../constants/xmlns_namespaces":486,"../lib":506,d3:81}],615:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],616:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;u=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":506}],621:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[a][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":506}],622:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;var u=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plot_api/edit_types":535,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],623:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function D(t,e){return null===t?e:t}function N(e,r,n){C();var i,a,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[d]:S(p,g,m);h[d]=b>-1?b:R(p,g,m,D(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++v}}function F(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function B(t){var e=.001*(L-E);return t>=E-e&&t<=L+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,i),j(e[1][3],n,i),j(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return B(e[0][3])&&B(e[1][3])&&B(e[2][3])?(N(t,e,r),!0):a<3&&V(t,e,r,E,L,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(h,c,n,i),p=F(h,f,n,i);o=l(t,[p,d,c],[-1,-1,r[a[0]]])||o,o=l(t,[c,f,p],[r[a[0]],r[a[1]],-1])||o,u=!0}})),u||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(f,c,n,i),p=F(h,c,n,i);o=l(t,[p,d,c],[-1,-1,r[a[0]]])||o,u=!0}})),o}function H(t,e,r,n){var i=!1,a=U(e),o=[j(a[0][3],r,n),j(a[1][3],r,n),j(a[2][3],r,n),j(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]];if(g)i=N(t,[u,c,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var d=F(h,u,r,n),p=F(h,c,r,n),v=F(h,f,r,n);i=N(null,[d,p,v],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(f,u,r,n),p=F(f,c,r,n),v=F(h,c,r,n),m=F(h,u,r,n);g?(i=N(t,[u,m,d],[e[l[0]],-1,-1])||i,i=N(t,[c,p,v],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,p,v,m],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(c,u,r,n),p=F(f,u,r,n),v=F(h,u,r,n);g?(i=N(t,[u,d,p],[e[l[0]],-1,-1])||i,i=N(t,[u,p,v],[e[l[0]],-1,-1])||i,i=N(t,[u,v,d],[e[l[0]],-1,-1])||i):i=N(null,[d,p,v],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,u,c){var f=!1;return p&&(I(t,"A")&&(f=H(null,[e,r,n,a],u,c)||f),I(t,"B")&&(f=H(null,[r,n,i,l],u,c)||f),I(t,"C")&&(f=H(null,[r,a,o,l],u,c)||f),I(t,"D")&&(f=H(null,[n,a,s,l],u,c)||f),I(t,"E")&&(f=H(null,[r,n,a,l],u,c)||f)),g&&(f=H(t,[r,n,a,l],u,c)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function X(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,u,c,f=!1,h=function(){f=V(t,[s,l,u],[-1,-1,-1],i,a)||f,f=V(t,[u,c,s],[-1,-1,-1],i,a)||f},d=o[0],p=o[1],g=o[2];return d&&(s=P(U([A(e,r-0,n-0)])[0],U([A(e-1,r-0,n-0)])[0],d),l=P(U([A(e,r-0,n-1)])[0],U([A(e-1,r-0,n-1)])[0],d),u=P(U([A(e,r-1,n-1)])[0],U([A(e-1,r-1,n-1)])[0],d),c=P(U([A(e,r-1,n-0)])[0],U([A(e-1,r-1,n-0)])[0],d),h()),p&&(s=P(U([A(e-0,r,n-0)])[0],U([A(e-0,r-1,n-0)])[0],p),l=P(U([A(e-0,r,n-1)])[0],U([A(e-0,r-1,n-1)])[0],p),u=P(U([A(e-1,r,n-1)])[0],U([A(e-1,r-1,n-1)])[0],p),c=P(U([A(e-1,r,n-0)])[0],U([A(e-1,r-1,n-0)])[0],p),h()),g&&(s=P(U([A(e-0,r-0,n)])[0],U([A(e-0,r-0,n-1)])[0],g),l=P(U([A(e-0,r-1,n)])[0],U([A(e-0,r-1,n-1)])[0],g),u=P(U([A(e-1,r-1,n)])[0],U([A(e-1,r-1,n-1)])[0],g),c=P(U([A(e-1,r-0,n)])[0],U([A(e-1,r-0,n-1)])[0],g),h()),f}function Y(t,e,r,n,i,a,o,s,l,u,c,f){var h=t;return f?(p&&"even"===t&&(h=null),q(h,e,r,n,i,a,o,s,l,u,c)):(p&&"odd"===t&&(h=null),q(h,l,s,o,a,i,n,r,e,u,c))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(p-k)?[T,p]:[p,k];J(e,M[0],M[1])}}var S=[[Math.min(E,k),Math.max(E,k)],[Math.min(T,L),Math.max(T,L)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(c.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);c.length>0&&(r[i]="x"===e?tt(null,c,a,o,f,r[i]):"y"===e?et(null,c,a,o,f,r[i]):rt(null,c,a,o,f,r[i]),i++),u.length>0&&(r[i]="x"===e?Z(null,u,a,o,r[i]):"y"===e?Q(null,u,a,o,r[i]):K(null,u,a,o,r[i]),i++)}var p=t.caps[e];p.show&&p.fill&&(z(p.fill),r[i]="x"===e?Z(null,[0,x-1],a,o,r[i]):"y"===e?Q(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===v&&O(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":390,"../../lib/gl_format_color":504,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":594,"gl-mesh3d":139}],625:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=a("x"),c=a("y"),f=a("z"),h=a("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":388,"../../lib":506,"../../registry":606,"./attributes":622}],626:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":583,"./attributes":622,"./calc":623,"./convert":624,"./defaults":625}],627:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../surface/attributes":673}],628:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":386}],629:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!v(t.i,f)||!v(t.j,f)||!v(t.k,f))return;n=c(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;os&&T[v].gap;)v--;for(y=T[v].s,p=T.length-1;p>v;p--)T[p].s=y;for(;sk[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],642:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=u(t,e,g,v),b=!y&&mG!=(N=R[C][1])>=G&&(z=R[C-1][0],I=R[C][0],N-D&&(P=z+(I-z)*(G-D)/(N-D),U=Math.min(U,P),V=Math.max(V,P)));U=Math.max(U,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:G,y1:G,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":378,"../../components/fx":418,"../../lib":506,"../../registry":606,"./get_trace_color":645}],647:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":565,"./arrays_to_calcdata":634,"./attributes":635,"./calc":636,"./cross_trace_calc":640,"./cross_trace_defaults":641,"./defaults":642,"./format_labels":644,"./hover":646,"./marker_colorbar":653,"./plot":655,"./select":656,"./style":658,"./subtypes":659}],648:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":388,"../../components/colorscale/helpers":389,"../../lib":506}],649:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,d,p,g,v,m,y,b,x,_,w,M,A,T,k,E=e.xaxis,L=e.yaxis,S="log"===E.type,C="log"===L.type,O=E._length,R=L._length,P=e.connectGaps,z=e.baseTolerance,I=e.shape,D="linear"===I,N=e.fill&&"none"!==e.fill,F=[],j=f.minTolerance,B=t.length,U=new Array(B),V=0;function H(r){var n=t[r];if(!n)return!1;var a=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?L.l2p(n.y):L.c2p(n.y);if(a===i){if(S&&(a=E.c2p(n.x,!0)),a===i)return!1;C&&l===i&&(a*=Math.abs(E._m*R*(E._m>0?o:s)/(L._m*O*(L._m>0?o:s)))),a*=1e3}if(l===i){if(C&&(l=L.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,Q]),ut(t),K=null,Z=Q=0}function ft(t){if(T=t[0]/O,k=t[1]/R,W=t[0]rt?rt:0,Y=t[1]it?it:0,W||Y){if(V)if(K){var e=J(K,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else $=J(U[V-1],t)[0],U[V++]=$;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?(K&&(Z!==W&&Q!==Y?ut(Z&&Q?(n=K,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||W,Q||Y]):Z&&Q&&ut([Z,Q])),ut([W,Y])):Z-W&&Q-Y&&ut([W||Z,Y||Q]),K=t,Z=W,Q=Y}else K&&ct(J(K,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===I||"spline"===I?J=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)G(p,ht))break;a=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}K&&ut([Z||K[0],Q||K[1]]),F.push(U.slice(0,V))}return F}},{"../../constants/numerical":485,"../../lib":506,"./constants":639}],650:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],651:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(a=0;a=0?l=d:(l=d=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":90}],653:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],654:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":378,"../../components/colorscale/defaults":388,"../../components/colorscale/helpers":389,"./subtypes":659}],655:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),A=o(M,"g","errorbars"),T=o(M,"g","lines"),k=o(M,"g","points"),E=o(M,"g","text");if(i.getComponentMethod("errorbars","plot")(t,A,r,g),!0===_.visible){var L,S;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,P="",z=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",S=I._nextFill,z=I._polygons);var D,N,F,j,B,U,V,H="",q="",G=[],X=a.noop;if(L=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(S&&S.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(D=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):D=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var W=T.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(L?(L.datum(f),j&&U&&(C?("y"===C?j[1]=U[1]=x.c2p(0,!0):"x"===C&&(j[0]=U[0]=b.c2p(0,!0)),y(L).attr("d","M"+U+"L"+j+"L"+H.substr(1)).call(l.singleFillStyle)):y(L).attr("d",H+"Z").call(l.singleFillStyle))):S&&("tonext"===_.fill.substr(0,6)&&H&&P?("tonext"===_.fill?y(S).attr("d",H+"Z"+P+"Z").call(l.singleFillStyle):y(S).attr("d",H+"L"+P.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(z)):(Z(S),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(L?Z(L):S&&Z(S),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),E.datum(f),function(e,i,a){var o,c=a[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?K:Q:_&&!w&&(v=$),f&&(p=v),h&&(g=v)}var M,A=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&A.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(c)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,c,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function Q(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function J(t){return t.id}function tt(t){if(t.ids)return J}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,p=!a,g=!!a&&a.duration>0,v=f(t,e,r);((c=i.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,a)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,a)}));p&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":400,"../../lib":506,"../../lib/polygon":518,"../../registry":606,"./line_points":649,"./link_traces":651,"./subtypes":659,d3:81}],656:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":506,"../../registry":606,"../scatter/line_defaults":648,"../scatter/marker_defaults":654,"../scatter/subtypes":659,"../scatter/text_defaults":660,"./attributes":662}],667:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":483,"../../plots/gl3d":583,"./attributes":662,"./calc":663,"./convert":665,"./defaults":666}],668:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],669:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/calc");function a(t){var e,r,i,a,s,l,u,c,f,h,d,p,g=t._x,v=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,A=1/0,T="";for(y&&(u=g[0],f=v[0],d=m[0]),y>1&&(c=g[y-1],h=v[y-1],p=m[y-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var S=function(){y=0,k=[],E=[],L=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function p(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var g=p(e._Xs,"xaxis"),v=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[g,v,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=v[0],b=h(g),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=g[n];break}return r}function b(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;aw;)r--,r/=y(r),++r<_&&(r=w);var n=Math.round(r/t);return n>1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,f=i(new Float32Array(u*c),[u,c]),h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],317:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],318:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(l(t)),")};return robustDeterminant",t].join(""))(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length<6;)f.push(c(f.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);for(e.exports=i.apply(void 0,f.concat([f,c])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var a=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;a.length<6;)a.push(i(a.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,a.concat([a,i])),n=0;n<6;++n)e.exports[n]=a[n]}()},{"robust-determinant":319}],323:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],d=r[2]-n[2],p=a*u,g=o*l,v=o*s,m=i*u,y=i*l,b=a*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++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;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],330:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":39,"reduce-simplicial-complex":315}],331:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,"undefined"==typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=A[0];return v(0,k-1),k-=1,b(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((k+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}var A=[],T=new Array(a);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;M(E)}var L=[];for(f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":323,"simplicial-complex":335}],338:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},{"./lib/order-segments":338,"binary-search-bounds":339,"functional-red-black-tree":93,"robust-orientation":323}],341:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":320,"robust-sum":328}],342:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+i).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+i+l:"0"===u?h+l+i:l+h+i)}return g}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],343:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;s c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var k=p[x].length/y*.5,E=.5+m[x]/y*.5;A.push("d"+x+"-"+E+"-"+k+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var L=[];for(u=0;u<1<1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=S(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(I(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},L=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function D(t){return R(t)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!B.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],345:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=a;function i(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=i(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return i(e,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":292}],346:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],o=0;oMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var d=h.prototype;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[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])]},d.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,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);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,M=b,A=-v*b,T=-m*b,k=y,E=this.computedEye,L=this.computedMatrix;for(a=0;a<3;++a){var S=_*r[a]+w*h[a]+M*e[a];L[4*a+1]=A*r[a]+T*h[a]+k*e[a],L[4*a+2]=S,L[4*a+3]=0}var C=L[1],O=L[5],R=L[9],P=L[2],z=L[6],I=L[10],D=O*I-R*z,N=R*P-C*I,F=C*z-O*P,j=u(D,N,F);D/=j,N/=j,F/=j,L[0]=D,L[4]=N,L[8]=F;for(a=0;a<3;++a)E[a]=x[a]+L[2+4*a]*d;for(a=0;a<3;++a){c=0;for(var B=0;B<3;++B)c+=L[a+4*B]*E[B];L[12+a]=-c}L[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,p);for(u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=u(c-=a*d,f-=o*d,h-=s*d),g=(c/=p)*e+a*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=u(b-=s*w,x-=l*w,_-=f*w),A=l*(_/=M)-f*(x/=M),T=f*(b/=M)-s*_,k=s*x-l*b,E=u(A,T,k);if(A/=E,T/=E,k/=E,this.center.jump(t,q,G,X),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===a){var L=e[1],S=e[5],C=e[9],O=L*b+S*x+C*_,R=L*A+S*T+C*k;m=D<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,O)}else{var P=e[2],z=e[6],I=e[10],D=P*s+z*l+I*f,N=P*b+z*x+I*_,F=P*A+z*T+I*k;m=Math.asin(c(D)),y=Math.atan2(F,N)}this.angle.jump(t,y,m),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,X=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-j*W,G-B*W,X-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=i*g+a*v+o*m,b=u(g-=y*i,v-=y*a,m-=y*o);if(!(b<.01&&(b=u(g=a*h-o*f,v=o*l-i*h,m=i*f-a*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,i,a,o),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=a*m-o*v,_=o*g-i*m,w=i*v-a*g,M=u(x,_,w),A=i*l+a*f+o*h,T=g*l+v*f+m*h,k=(x/=M)*l+(_/=M)*f+(w/=M)*h,E=Math.asin(c(A)),L=Math.atan2(k,T),S=this.angle._state,C=S[S.length-1],O=S[S.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-L),P=Math.abs(C-L),z=Math.abs(C-2*Math.PI-L);R0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function M(t){return s?new BigUint64Array(d(8*t),0,t):null}function A(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return M(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=M,r.mallocBigInt64=A,r.mallocDataView=T,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":37,buffer:49,dup:86}],351:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",a="",o=i.length,s=a.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(i);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var i=c(t,n),a=function(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;l=0?e[a]:i}))},has___:{value:y((function(e){var n=m(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=m(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=m(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};p.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof p||b();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new p),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new p),i.set___(t,e)}else n.set(t,e);return this},Object.create(p.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=p.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=p)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function v(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function m(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function b(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],356:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":357}],357:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],358:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":356}],359:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":95}],360:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":77}],361:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":360}],362:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],363:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":542,"../../plots/cartesian/constants":558,"../../plots/font_attributes":580,"./arrow_paths":362}],364:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":506,"../../plots/cartesian/axes":552,"./draw":369}],365:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,G=["x","y"],X=0;X1)&&(tt===J?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(q=!0):q=!0),W=et._offset+et.r2p(e[$]),Q=.5}else"x"===$?(Z=e[$],W=x.l+x.w*Z):(Z=1-e[$],W=x.t+x.h*Z),Q=e.showarrow?.5:Z;if(e.showarrow){lt.head=W;var ct=e["a"+$];K=nt*U(.5,e.xanchor)-it*U(.5,e.yanchor),tt===J?(lt.tail=et._offset+et.r2p(ct),Y=K):(lt.tail=W+ct,Y=K+ct),lt.text=lt.tail+K;var ft=b["x"===$?"width":"height"];if("paper"===J&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),dt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):dt>0&&(lt.tail-=dt,lt.text-=dt)}lt.tail+=st,lt.head+=st}else Y=K=at*U(Q,ot),lt.text=W+K;lt.text+=st,K+=st,Y+=st,e["_"+$+"padplus"]=at/2+Y,e["_"+$+"padminus"]=at/2-Y,e["_"+$+"size"]=at,e["_"+$+"shift"]=K}if(q)P.remove();else{var pt=0,gt=0;if("left"!==e.align&&(pt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(R-y)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:D+pt-1,y:D+gt}).call(u.setClipUrl,F?k:null,t);else{var vt=D+gt-p.top,mt=D+pt-p.left;V.call(f.positionText,mt,vt).call(u.setClipUrl,F?k:null,t)}j.select("rect").call(u.setRect,D,D,w,R),N.call(u.setRect,z/2,z/2,I-z,B-z),P.call(u.setTranslate,Math.round(E.x.text-I/2),Math.round(E.y.text-B/2)),C.attr({transform:"rotate("+L+","+E.x.text+","+E.y.text+")"});var yt,bt=function(r,n){S.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,p=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,b=o.rotationXYMatrix(L,m,y),w=o.apply2DTransform(b),k=o.apply2DTransform2(b),O=+N.attr("width"),R=+N.attr("height"),z=m-.5*O,I=z+O,D=y-.5*R,F=D+R,j=[[z,D,z,F],[z,F,I,F],[I,F,I,D],[I,D,z,D]].map(k);if(!j.reduce((function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){j.forEach((function(t){var e=o.segmentsIntersect(h,p,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var B=e.arrowwidth,U=e.arrowcolor,V=e.arrowside,H=S.append("g").style({opacity:l.opacity(U)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+h+","+p+"L"+c+","+f).style("stroke-width",B+"px").call(l.stroke,l.rgb(U));if(g(q,V,e),_.annotationPosition&&q.node().parentNode&&!a){var G=c,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-p,2));G+=e.standoff*(h-c)/W,X+=e.standoff*(p-f)/W}var Y,Z,Q=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(p-X),transform:"translate("+G+","+X+")"}).style("stroke-width",B+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);Y=t.x,Z=t.y,s&&s.autorange&&M(s._name+".autorange",!0),v&&v.autorange&&M(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,Z),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),A("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),A("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&A("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&A("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),C.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&bt(0,0),O)d.init({element:P.node(),gd:t,prepFn:function(){yt=C.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?A("ax",s.p2r(s.r2p(e.ax)+t)):A("ax",e.ax+t),e.ayref===e.yref?A("ay",v.p2r(v.r2p(e.ay)+r)):A("ay",e.ay+r),bt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=d.align(u+t/x.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var c=e._ysize/x.h,f=e.y-(e._yshift+e.yshift)/x.h-c/2;o=d.align(f-r/x.h,c,0,1,e.yanchor)}A("x",i),A("y",o),s&&v||(n=d.getCursor(s?.5:i,v?.5:o,e.xanchor,e.yanchor))}C.attr({transform:"translate("+t+","+r+")"+yt}),h(P,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",H(n))},doneFn:function(){h(P),i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void O();if(m){if(m*m>b*b+x*x)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void O();var M=y*Math.cos(l),A=y*Math.sin(l);o.x-=M,o.y-=A,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),k="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":592,"../annotations/draw":369}],376:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));X*=Z*u.roundUp(Y/Z,[2,5,10]),(Math.abs(S.start)/S.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=X}G.domain=[V+j,V+D-j],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var Q,K=t.select("."+A.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+A.cbaxis),J=0;function tt(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+N)*l.w,n=G.title.font.size;t="top"===T?(1-(V+D-j))*l.h+l.t+3+.75*n:(1-(V+j))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var a=t.select("."+A.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=a.select(".h"+G._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*_),f?(J=h.bBox(f).height)>d&&(c[1]-=(J-d)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(J=h.bBox(o.node()).height),J){if(J+=5,"top"===T)G.domain[1]-=J/l.h,c[1]*=-1;else{G.domain[0]+=J/l.h;var p=g.lineCount(o);c[1]+=(1-p)*d}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).data(O);m.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),m.exit().remove();var y=k.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));m.each((function(t,a){var o=[0===a?k[0]:(O[a]+O[a-1])/2,a===O.length-1?k[1]:(O[a]+O[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:B,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(v.color&&v.width?R:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(t))+v.width/2%1)+"h"+P).call(h.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var x=B+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),M=s.makeTransFn(G),S=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:$,path:s.makeTickPath(G,x,S),transFn:M}),s.drawLabels(r,G,{vals:w,layer:$,transFn:M,labelFns:s.makeLabelFns(G,x)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=P+e.outlinewidth/2+h.bBox($.node()).width;if((Q=K.select("text")).node()&&!Q.classed(A.jsPlaceholder)){var i,o=K.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(K.node()).right-B-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-q;t.select("."+A.cbbg).attr({x:B-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-F,width:Math.max(s,2),height:Math.max(u+2*F,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:B,y:q+e.ypad+("top"===T?J:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-J,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},p=w[e.yanchor],g=M[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*p,f.b=u*g):(f.t=f.b=0,f.yt=e.y+e.len*p,f.yb=e.y-e.len*g);var v=w[e.xanchor],m=M[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*m;else{var y=s-P;f.l=y*v,f.r=y*m,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*m}a.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);f(t,u)},doneFn:function(){if(f(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":480,"../../lib":506,"../../lib/extend":500,"../../lib/setcursor":525,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":552,"../../plots/cartesian/axis_defaults":554,"../../plots/cartesian/layout_attributes":566,"../../plots/cartesian/position_defaults":569,"../../plots/plots":597,"../../registry":606,"../color":378,"../colorscale/helpers":389,"../dragelement":397,"../drawing":400,"../titles":473,"./constants":380,d3:81,tinycolor2:344}],383:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":506}],384:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":379,"./defaults":381,"./draw":382,"./has_colorbar":383}],385:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var d=s+"auto",p=s+"min",g=s+"max",v=s+"mid",m=(o(h+d),o(h+p),o(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":521,"../colorbar/attributes":379,"./scales.js":393}],386:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,f=a(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":506,"./helpers":389,"fast-isnumeric":90}],387:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],395:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":506}],396:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],397:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":506,"../../plots/cartesian/constants":558,"./align":394,"./cursor":395,"./unhover":398,"has-hover":248,"has-passive-events":249,"mouse-event-offset":271}],398:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":498,"../../lib/events":499,"../../lib/throttle":530,"../fx/constants":412}],399:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],400:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,m=e.exports={};m.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);m.translatePoint(t,i,e,r)}))},m.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){m.hideOutsideRangePoint(t,n.select(this),r,i,s,l)}))}))}},m.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(m.dashLine,l,o)}))},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;m.symbolList.push(r,t,r+100,t+"-open"),m.symbolNames[r]=t,m.symbolFuncs[r]=e.f,e.needLine&&(m.symbolNeedLines[r]=!0),e.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(m.symbolNoFill[r]=!0)}));var b=m.symbolNames.length;function x(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}m.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=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},M=n.format("~.1f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};m.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=A[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},m.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},m.pointStyle=function(t,e,r){if(t.size()){var i=m.makePointStyleFns(e);t.each((function(t){m.singlePointStyle(t,n.select(this),e,i,r)}))}},m.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=m.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so)d=o.outlierwidth,h=o.outliercolor,f=a.outliercolor;else{var g=(o||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=a.gradient,y=t.mgt;if(y?p=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],A[y]||(y=0)),y&&"none"!==y){var b=t.mgc;b?p=!0:b=v.color;var _=r.uid;p&&(_+="-"+t.i),m.gradient(e,i,_,y,[[0,b],[1,f]],"fill")}else s.fill(e,f);d&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=i.color,v=a.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=i.size,b=a.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(m.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=m.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var f=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};v(h,e,t.i);var d=e._meta||{};l=u.texttemplateString(l,f,s._d3locale,h,t,d)}var p=t.tp||e.textposition,g=E(t,e),y=i?i(t):t.tc||e.textfont.color;a.call(m.font,t.tf||e.textfont.family,g,y).text(l).call(c.convertToTspans,r).call(k,p,g,t.mrc)}else a.remove()}))}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=E(t,e);s.fill(i,a),k(i,o,l,t.mrc2||t.mrc)}))}};function L(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(m.savedBBoxes={},O=0),r&&(m.savedBBoxes[r]=v),O++,u.extendFlat({},v)},m.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},m.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},m.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var z=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":414,"../../constants/alignment":480,"../../constants/interactions":484,"../../constants/xmlns_namespaces":486,"../../lib":506,"../../lib/svg_text_utils":529,"../../registry":606,"../../traces/scatter/make_bubble_size_func":652,"../../traces/scatter/subtypes":659,"../color":378,"../colorscale":390,"./symbol_defs":401,d3:81,"fast-isnumeric":90,tinycolor2:344}],401:[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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:81}],402:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],403:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(a+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":659,"../drawing":400,d3:81,"fast-isnumeric":90}],408:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":378,d3:81}],409:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":500,"../../plots/font_attributes":580,"./layout_attributes":419}],410:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=J+x[0]._offset,e.pointerY=tt+w[0]._offset,z="xval"in e?g.flat(l,e.xval):g.p2c(x,J),I="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!i(z[0])||!i(I[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(N=0;NX&&(Z.splice(0,X),rt=Z[0].distance),m&&0!==Y&&0===Z.length){G.distance=Y,G.index=!1;var h=j._module.hoverPoints(G,H,q,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=Y}))),h&&h.length){var d,p=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];i(v.x0)&&i(v.y0)&&(d=at(v),(!K.vLinePoint||K.vLinePoint.spikeDistance>d.spikeDistance)&&(K.vLinePoint=d))}var y=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];i(b.x0)&&i(b.y0)&&(d=at(b),(!K.hLinePoint||K.hLinePoint.spikeDistance>d.spikeDistance)&&(K.hLinePoint=d))}}}}}function it(t,e){for(var r,n=null,i=1/0,a=0;a1||Z.length>1)||"closest"===S&&$&&Z.length>1,Tt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),kt={hovermode:S,rotateLabels:At,bgColor:Tt,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Et=L(Z,kt,t);g.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?_:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(a=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var w=x[s],M=w.datum;M.offset=w.dp,M.del=w.del}}}(Et,At?"xa":"ya",c),C(Et,At));if(e.target&&e.target.tagName){var Lt=p.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),Lt?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,bt))return;bt&&t.emit("plotly_unhover",{event:e,points:bt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:z,yvals:I})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map((function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o},l=L(i,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function L(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},x=e.fontFamily||v.HOVERFONT,_=e.fontSize||v.HOVERFONTSIZE,w=t[0],M=w.xa,E=w.ya,L="y"===a.charAt(0)?"yLabel":"xLabel",C=w[L],O=(String(C)||"").split(" ")[0],R=d.node().getBoundingClientRect(),P=R.top,z=R.width,I=R.height,D=void 0!==C&&w.distance<=e.hoverdistance&&("x"===a||"y"===a);if(D){var N,F,j=!0;for(N=0;Ni.width-L?(m=i.width-L,s.attr("d","M"+(L-A)+",0L"+L+","+k+A+"v"+k+(2*T+b.height)+"H-"+L+"V"+k+A+"H"+(L-2*A)+"Z")):s.attr("d","M0,0L"+A+","+k+A+"H"+(T+b.width/2)+"v"+k+(2*T+b.height)+"H-"+(T+b.width/2)+"V"+k+A+"H-"+A+"Z")}else{var S,O,R;"right"===E.side?(S="start",O=1,R="",m=M._offset+M._length):(S="end",O=-1,R="-",m=M._offset),y=E._offset+(w.y0+w.y1)/2,u.attr("text-anchor",S),s.attr("d","M0,0L"+R+A+","+A+"V"+(T+b.height/2)+"h"+R+(2*T+b.width)+"V-"+(T+b.height/2)+"H"+R+A+"V-"+A+"Z");var z,I=b.height/2,D=P-b.top-I,N="clip"+i._uid+"commonlabel"+E._id;if(m=0?J-=rt:J+=2*T;var nt=et.height+2*T,it=$+nt>=I;return nt<=I&&($<=P?$=E._offset+2*T:it&&($=I-nt)),tt.attr("transform","translate("+J+","+$+")"),tt}var at=h.selectAll("g.hovertext").data(t,(function(t){return k(t)}));return at.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,_)})),at.exit().remove(),at.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=f.combine(f.opacity(o)?o:f.defaultLine,u),d=f.combine(f.opacity(t.color)?t.color:f.defaultLine,u),p=t.borderColor||f.contrast(h),g=S(t,D,a,i,C,e),v=g[0],m=g[1],y=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||_,t.fontColor||p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),M=0,k=0;if(m&&m!==v){w.call(c.font,t.fontFamily||x,t.fontSize||_,d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var E=w.node().getBoundingClientRect();M=E.width+2*T,k=E.height+2*T}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:p});var L,O,R=y.node().getBoundingClientRect(),N=t.xa._offset+(t.x0+t.x1)/2,F=t.ya._offset+(t.y0+t.y1)/2,j=Math.abs(t.x1-t.x0),B=Math.abs(t.y1-t.y0),U=R.width+A+T+M;if(t.ty0=P-R.top,t.bx=R.width+2*T,t.by=Math.max(R.height+2*T,k),t.anchor="start",t.txwidth=R.width,t.tx2width=M,t.offset=0,s)t.pos=N,L=F+B/2+U<=I,O=F-B/2-U>=0,"top"!==t.idealAlign&&L||!O?L?(F+=B/2,t.anchor="start"):t.anchor="middle":(F-=B/2,t.anchor="end");else if(t.pos=F,L=N+j/2+U<=z,O=N-j/2-U>=0,"left"!==t.idealAlign&&L||!O)if(L)N+=j/2,t.anchor="start";else{t.anchor="middle";var V=U/2,H=N+V-z,q=N-V;H>0&&(N-=H),q<0&&(N+=-q)}else N-=j/2,t.anchor="end";y.attr("text-anchor",t.anchor),M&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+N+","+F+")"+(s?"rotate("+b+")":""))})),at}function S(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=z(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===i?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,f=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,f,u,h,t.trace._meta)).replace(E,(function(e,r){return s=z(r,t.nameLength),""}))),[l,s]}function C(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(A+T),f=u+s*(t.txwidth+T),h=0,d=t.offset;"middle"===a&&(u-=t.tx2width/2,f+=t.txwidth/2+T),e&&(d*=-M,h=t.offset*w),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*A+h)+","+(A+d)+"v"+(t.by/2-A)+"h"+o*t.bx+"v-"+t.by+"H"+(o*A+h)+"V"+(d-A)+"Z");var p=u+h,g=d+t.ty0-t.by/2+T,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==a?(i.attr("text-anchor","start"),p="middle"===a?-t.bx/2-t.tx2width/2+T:-t.bx-T):"right"===v&&"end"!==a&&(i.attr("text-anchor","end"),p="middle"===a?t.bx/2-t.tx2width/2-T:t.bx+T)),i.call(l.positionText,p,g),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*T+h,d+t.ty0-t.by/2+T),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,d-t.by/2-1,t.tx2width,t.by+2))}))}function O(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||h){var g=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,g)<1.5?f.contrast(g):y.color,w=i.spikemode,M=i.spikethickness,A=i.spikecolor||_,T=d.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var k=i._counterDomainMin,E=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),E=Math.max(E,i.position)),b=l.l+k*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:A,"stroke-dasharray":c.dashStyle(i.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?M:-M),cy:m,r:M,fill:A}).classed("spikeline",!0)}if(p){var L,S,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(L=u.pointerX,S=u.pointerY):(L=n._offset+C.x,S=i._offset+C.y);var O,R,P=a.readability(C.color,g)<1.5?f.contrast(g):C.color,z=n.spikemode,I=n.spikethickness,D=n.spikecolor||P,N=d.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(O=N,R=S),-1!==z.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=l.t+(1-j)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:O,y2:R,"stroke-width":I,stroke:D,"stroke-dasharray":c.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:O,y2:R,"stroke-width":I+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:N-("top"!==n.side?I:-I),r:I,fill:D}).classed("spikeline",!0)}}}function P(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function z(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":506,"../../lib/events":499,"../../lib/override_cursor":517,"../../lib/svg_text_utils":529,"../../plots/cartesian/axes":552,"../../registry":606,"../color":378,"../dragelement":397,"../drawing":400,"../legend/defaults":430,"../legend/draw":431,"./constants":412,"./helpers":414,d3:81,"fast-isnumeric":90,tinycolor2:344}],416:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":506,"../color":378,"./helpers":414}],417:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}var o,s=a("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!d&&!p)"independent"===A("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===A("roworder"),w=h?.2:.1,M=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",A,w,b,y),y:c("y",A,M,x,m,_)}}else delete e.grid}function A(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=a.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),i.coerceFont(_,"font",e.font);var m,y,b,x=_("orientation");"h"===x?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),_("traceorder",h),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",b),_("valign"),i.noneOrAll(u,v,["x","y"]),_("title.text")&&(_("title.side","h"===x?"left":"top"),i.coerceFont(_,"title.font",e.font))}}function _(t,e){return i.coerce(u,v,o,t,e)}}},{"../../lib":506,"../../plot_api/plot_template":542,"../../plots/layout_attributes":595,"../../registry":606,"./attributes":428,"./helpers":434}],431:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a=t.data()[0][0],s=a.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,p=r._maxNameLength;r.entries?n=a.text:(n=l?a.label:s.name,s._meta&&(n=i.templateString(n,s._meta)));var g=i.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?M(n,p):n),f.positionText(g,d.textGap,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(T,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(T,t,e,r);var s=a.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),f=u[u.length-1],h=i.keyedContainer(s,"transforms["+f+"].styles","target","value.name");h.set(a.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):T(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function T(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),a=i.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*g;if(a){var h=u.bBox(a);o=h.height,s=h.width,n?u.setTranslate(i,0,.25*o):u.setTranslate(i,l,.75*o+l)}else{var p=t.select(n?".legendtext":".legendtitletext"),v=f.lineCount(p),m=p.node();o=c*v,s=m?u.bBox(m).width:0;var y=c*((v-1)/2-.3);n?f.positionText(p,d.textGap,-y):f.positionText(p,d.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function k(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function E(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,f="legend"+s._uid;if(e?(r=e.layer,f+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;h=y(e.entries,e)}var p=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+f).remove(),a.autoMargin(t,"legend");var g=i.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),M=i.ensureSingleById(s._topdefs,"clipPath",f,(function(t){t.append("rect")})),L=i.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var S=i.ensureSingle(g,"g","scrollbox"),C=e.title;if(e._titleWidth=0,e._titleHeight=0,C.text){var O=i.ensureSingle(S,"text","legendtitletext");O.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,C.font).text(C.text),T(O,S,t,e)}else S.selectAll(".legendtitletext").remove();var R=i.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),P=S.selectAll("g.groups").data(h);P.enter().append("g").attr("class","groups"),P.exit().remove();var z=P.selectAll("g.traces").data(i.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){e._main&&n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),c=i.borderwidth,f=2*c,h=d.textGap,p=d.itemGap,g=2*(c+p),v=E(i),m=i.y<0||0===i.y&&"top"===v,y=i.y>1||1===i.y&&"bottom"===v;i._maxHeight=Math.max(m||y?a.height/2:o.h,30);var b=0;i._width=0,i._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+_[0],c+_[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),b=h+i._width,i._width+=p+h+f,i._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=k(i),M=i.x<0||0===i.x&&"right"===w,A=i.x>1||1===i.x&&"left"===w,T=y||m,L=a.width/2;i._maxWidth=Math.max(M?T&&"left"===w?o.l+o.w:L:A?T&&"right"===w?o.r+o.w:L:o.w,2*h);var S=0,C=0;r.each((function(t){var e=t[0].width+h;S=Math.max(S,e),C+=e})),b=null;var O=0;if(l){var R=0,P=0,z=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,_[0],_[1]+c+p+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),R=Math.max(R,e);var r=t+p;r+c+P>i._maxWidth&&(O=Math.max(O,P),P=0,z+=R+i.tracegroupgap,R=e),u.setTranslate(this,P,z),P+=r})),i._width=Math.max(O,P)+c,i._height=z+R+g}else{var I=r.size(),D=C+f+(I-1)*pi._maxWidth&&(O=Math.max(O,B),F=0,j+=N,i._height+=N,N=0),u.setTranslate(this,_[0]+c+F,_[1]+c+j+e/2+p),B=F+r+p,F+=n,N=Math.max(N,e)})),D?(i._width=F+f,i._height=N+g):(i._width=Math.max(O,B)+f,i._height+=N+g)}}i._width=Math.ceil(Math.max(i._width+_[0],i._titleWidth+2*(c+d.titlePad))),i._height=Math.ceil(Math.max(i._height+_[1],i._titleHeight+2*(c+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var U=t._context.edits,V=U.legendText||U.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?h:b||h+t[0].width;s||(i+=p/2),u.setRect(e,0,-r/2,i,r)}))}(t,P,z,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=k(e),n=E(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var c,h,p,y,b=s._size,x=e.borderwidth,w=b.l+b.w*e.x-v[k(e)]*e._width,A=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var T=w,C=A;w=i.constrain(w,0,s.width-e._width),A=i.constrain(A,0,s.height-e._effHeight),w!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==C&&i.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(g,w,A),R.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var O=e._effHeight;e._main||(O=e._height),L.attr({width:e._width-x,height:O-x,x:x/2,y:x/2}),u.setTranslate(S,0,0),M.select("rect").attr({width:e._width-2*x,height:O-2*x,x:x,y:x}),u.setClipUrl(S,f,t),u.setRect(R,0,0,0,0),delete e._scrollY}else{var P,z,I,D=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-D-2*d.scrollBarMargin,F=e._height-e._effHeight,j=N/F,B=Math.min(e._scrollY||0,F);L.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),M.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+B}),u.setClipUrl(S,f,t),H(B,D,j),g.on("wheel",(function(){H(B=i.constrain(e._scrollY+n.event.deltaY/N*F,0,F),D,j),0!==B&&B!==F&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=B})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(z="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(B=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,F)}(I,P,z),D,j))}));R.call(U);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,I=B)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(z=t.changedTouches[0].clientY,H(B=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,F)}(I,P,z),D,j))}));S.call(V)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=u.getTranslate(g);p=t.x,y=t.y},moveFn:function(t,r){var n=p+t,i=y+r;u.setTranslate(g,n,i),c=l.align(n,0,b.l,b.l+b.w,e.xanchor),h=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&_(t,g,i,e,n)}})}function H(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(S,0,-r),u.setRect(R,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),M.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":480,"../../lib":506,"../../lib/events":499,"../../lib/svg_text_utils":529,"../../plots/plots":597,"../../registry":606,"../color":378,"../dragelement":397,"../drawing":400,"./constants":429,"./get_legend_data":432,"./handle_click":433,"./helpers":434,"./style":436,d3:81}],432:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,f=0,h=e._main;function d(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return p?n:Math.min(i,r)};function v(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],i=g(r.mlw,o.line,5,2);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)}))}function m(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,d=g(f(h.width,o.pts),h,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=h.color;var v=a.minExtend(o,{trace:p});c(u,v,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));i.attr("transform","translate(0,"+u+")")}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=i.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,u=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,f=n.select(this),d=l(i),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;c=0===u?p[g?v-1:0][1]:1===u?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(m)?m[u]||m[0]:m}f.attr("d",t[0]),c?f.call(s.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;o.gradient(t,e,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,v(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=g(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)}))})).each((function(t){v(t,this,"funnel")})).each((function(t){v(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=g(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:p?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){m(t,this,"funnelarea")})).each((function(t){m(t,this,"pie")})).each((function(t){var r,i,s=t[0],c=s.trace,f=c.visible&&c.fill&&"none"!==c.fill,d=u.hasLines(c),p=c.contours,v=!1,m=!1,y=l(c),b=y.colorscale,x=y.reversescale;if(p){var _=p.coloring;"lines"===_?v=!0:d="none"===_||"heatmap"===_||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==_&&"heatmap"!==_||(m=!0)}var w=u.hasMarkers(c)||u.hasText(c),M=f||m,A=d||v,T=w||!M?"M5,0":A?"M5,-2":"M5,-3",k=n.select(this),E=k.select(".legendfill").selectAll("path").data(f||m?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),b,"fill")}}),d||v){var L=g(void 0,c.line,10,5);i=a.minExtend(c,{line:{width:L}}),r=[a.minExtend(s,{trace:i})]}var S=k.select(".legendlines").selectAll("path").data(d||v?[r]:[]);S.enter().append("path").classed("js-line",!0),S.exit().remove(),S.attr("d",T+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),b,"stroke")}})})).each((function(t){var r,i,s=t[0],l=s.trace,c=u.hasMarkers(l),f=u.hasText(l),h=u.hasLines(l);function d(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(p&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||f||h){var v={},m={};if(c){v.mc=d("marker.color",g),v.mx=d("marker.symbol",g),v.mo=d("marker.opacity",a.mean,[.2,1]),v.mlc=d("marker.line.color",g),v.mlw=d("marker.line.width",a.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=d("marker.size",a.mean,[2,16],12);v.ms=y,m.marker.size=y}h&&(m.line={width:d("line.width",g,[0,10],5)}),f&&(v.tx="Aa",v.tp=d("textposition",g),v.ts=10,v.tc=d("textfont.color",g),v.tf=d("textfont.family",g)),r=[a.minExtend(s,v)],(i=a.minExtend(l,m)).selectedpoints=null,i.texttemplate=null}var b=n.select(this).select("g.legendpoints"),x=b.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var _=b.selectAll("g.pointtext").data(f?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=g(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=g(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}},{"../../lib":506,"../../registry":606,"../../traces/pie/helpers":632,"../../traces/pie/style_one":633,"../../traces/scatter/subtypes":659,"../color":378,"../colorscale/helpers":389,"../drawing":400,d3:81}],437:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(L=["toggleHover"],S=["resetViews"]):p?(E=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],S=["resetGeo"]):d?(L=["hoverClosest3d"],S=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(E=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],S=["resetViewMapbox"]):m?L=["hoverClosestGl2d"]:g?L=["hoverClosestPie"]:_?(L=["hoverClosestCartesian","hoverCompareCartesian"],S=["resetViewSankey"]):L=["toggleHover"];h&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=D[r+1];else if(t=n.pmax)e=D[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(A=f,L="y0",T=y,S="y1"):(A=y,L="y1",T=f,S="y0");W(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===P?Y:Z,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),K(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;K(s)}};function W(r){if(m(t))P=null;else if(D)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),P=l.split("-")[0]}}function Y(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?F("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},B&&"date"===B.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else z?F("xanchor",r.xanchor=H(b+n)):(F("x0",r.x0=H(u+n)),F("x1",r.x1=H(v+n))),I?F("yanchor",r.yanchor=q(M+i)):(F("y0",r.y0=q(f+i)),F("y1",r.y1=q(y+i)));e.attr("d",_(t,r)),Q(s,r)}function Z(n,i){if(N){var a=function(t){return t},o=a,l=a;z?F("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(U(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},B&&"date"===B.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(D){if("resize-over-start-point"===P){var c=u+n,h=I?f-i:f+i;F("x0",r.x0=z?c:H(c)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===P){var d=v+n,p=I?y-i:y+i;F("x1",r.x1=z?d:H(d)),F("y1",r.y1=I?p:q(p))}}else{var m=function(t){return-1!==P.indexOf(t)},x=m("n"),G=m("s"),X=m("w"),W=m("e"),Y=x?A+i:A,Z=G?T+i:T,K=X?k+n:k,$=W?E+n:E;I&&(x&&(Y=A-i),G&&(Z=T-i)),(!I&&Z-Y>10||I&&Y-Z>10)&&(F(L,r[L]=I?Y:q(Y)),F(S,r[S]=I?Z:q(Z))),$-K>10&&(F(C,r[C]=z?K:H(K)),F(O,r[O]=z?$:H($)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(z||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=U(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=V(I?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),z&&I){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function K(t){t.selectAll(".visual-cue").remove()}h.init(X),G.node().onmousemove=W}(t,z,l,e,r,P):!0===l.editable&&z.style("pointer-events",O||u.opacity(E)*k<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,v(t)}}(t,z)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=a.getFromId(t,e.xref),v=a.getFromId(t,e.yref),m=t._fullLayout._size;if(d?(r=g.shapePositionToRange(d),n=function(t){return d._offset+d.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=g.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===h)return d&&"date"===d.type&&(n=g.decodeDate(n)),v&&"date"===v.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,f=b-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,_=(c+f)/2,w=Math.abs(x-l),M=Math.abs(_-c),A="A"+w+","+M,T=x+w+","+_;return"M"+T+A+" 0 1,1 "+(x+","+(_-M))+A+" 0 0,1 "+T+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),T&&!h)&&(A=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===M&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function R(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function S(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,v);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||f<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform","translate("+v+")")}}}return z.call(I),R&&(E?z.on(".opacity",null):(A=0,T=!0,z.text(m).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,v,e,y):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),z.classed("js-placeholder",T),w}}},{"../../constants/alignment":480,"../../constants/interactions":484,"../../lib":506,"../../lib/svg_text_utils":529,"../../plots/plots":597,"../../registry":606,"../color":378,"../drawing":400,d3:81,"fast-isnumeric":90}],474:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":500,"../../plot_api/edit_types":535,"../../plot_api/plot_template":542,"../../plots/font_attributes":580,"../../plots/pad_attributes":596,"../color/attributes":377}],475:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],476:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":506,"../../plots/array_container_defaults":548,"./attributes":474,"./constants":475}],477:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(E,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(M,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},A={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(_,o)}))})),c.call(_,o),b?(A.w=Math.max(m.openWidth,m.headerWidth),A.h=x.y-A.t):(A.w=x.x-A.l,A.h=Math.max(m.openHeight,m.headerHeight)),A.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,d=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,E=p,L=v+m;L+k>u&&(L=u-k);var S=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),A?(this.hbar=S.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:L,width:T,height:k}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,P=p+g,z=v;P+O>l&&(P=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:z,width:O,height:R}),this._vbarYMin=z+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var D=this.id,N=c-.5,F=C?f+O+.5:f+.5,j=h-.5,B=A?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+D).data(A||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",D).append("rect"),A||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(a.setClipUrl,D,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),A||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":506,"../color":378,"../drawing":400,d3:81}],480:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],481:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],482:[function(t,e,r){"use strict";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]}},{}],483:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],484:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],485:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],486:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],487:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],490:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],491:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":513}],492:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),M=t.match(w?b:y);if(!M)return c;var A=M[1],T=M[3]||"1",k=Number(M[5]||1),E=Number(M[7]||0),L=Number(M[9]||0),S=Number(M[11]||0);if(u){if(2===A.length)return c;var C;A=Number(A);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===T.charAt(T.length-1);T=parseInt(T,10),C=O.newDate(A,O.toMonthIndex(A,T,R),k)}else C=O.newDate(A,Number(T),k)}catch(t){return c}return C?(C.toJD()-g)*f+E*h+L*d+S*p:c}A=2===A.length?(Number(A)+2e3-x)%100+x:Number(A),T-=1;var P=new Date(Date.UTC(2e3,T,k,E,L));return P.setUTCFullYear(A),P.getUTCMonth()!==T||P.getUTCDate()!==k?c:P.getTime()+S*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*f,A=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,L=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function L(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var S=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),S[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var C=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+C);return u.setUTCMonth(u.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,d=u-a,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,i-t,a-e),l(c,f,p,o-t,u-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":513}],504:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=a(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=a(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=v?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;xo?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var S=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var i;return S.test(n)?i=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,i=r[n]()),l.isValidTextValue(i)?i:""}))};var C={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return P.apply(C,arguments)};var O={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return P.apply(O,arguments)};var R=/^[:|\|]/;function P(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,f,h,d;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var z=2e9;l.seedPseudoRandom=function(){z=2e9},l.pseudoRandom=function(){var t=z;return z=(69069*z+1)%4294967296,Math.abs(z-t)<429496729?l.pseudoRandom():z/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(i-u*(r+o))+","+(a-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":485,"./anchor_utils":490,"./angles":491,"./array":492,"./clean_number":493,"./clear_responsive":495,"./coerce":496,"./dates":497,"./dom":498,"./extend":500,"./filter_unique":501,"./filter_visible":502,"./geometry2d":503,"./identity":505,"./is_plain_object":507,"./keyed_container":508,"./localize":509,"./loggers":510,"./make_trace_groups":511,"./matrix":512,"./mod":513,"./nested_property":514,"./noop":515,"./notifier":516,"./push_unique":519,"./regex":521,"./relative_attr":522,"./relink_private":523,"./search":524,"./stats":527,"./throttle":530,"./to_log_range":531,d3:81,"fast-isnumeric":90}],507:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],508:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":540,"./notifier":516}],511:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{d3:81}],512:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],514:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;la||u===i||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":485,"./matrix":512}],519:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},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;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":492,"fast-isnumeric":90}],528:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":62}],529:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,T){var k=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&k.match(l),S=n.select(t.node().parentNode);if(!S.empty()){var C=t.attr("class")?t.attr("class").split(" ")[0]:"text";return C+="-math",S.selectAll("svg."+C).remove(),S.selectAll("g."+C+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(L[2],a,(function(n,i,a){S.selectAll("svg."+C).remove(),S.selectAll("g."+C+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return O(),void e();var l=S.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:C,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||s(t,"height"))/4;"y"===C[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===C[0]?o.attr({x:t.attr("x"),y:p-h/2}):"a"===C[0]&&0!==C.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-h/2}),T&&T.call(t,l),e(l)}))}))):O(),t}function O(){S.empty()||(C=t.attr("class")+"-math",S.select("svg."+C).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}y.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(v),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,p-i)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var T={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},k=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(k,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):T[e])||t}))}function L(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}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],531:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":90}],532:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],533:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],534:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,M,A,T,k,E=Object.keys(r).map(Number).sort(o),L=e.get(),S=L||[],C=c(m,f).get(),O=[],R=-1,P=S.length;for(b=0;bS.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==A)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(A)?O.push(_):T?("add"===A&&(A={}),S.splice(_,0,A),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,A),-1===R&&(R=_);else for(x=0;x=0;b--)S.splice(O[b],1),C&&C.splice(O[b],1);if(S.length?L||e.set(S):e.set(null),g)return!1;if(h(v,m),p!==i){var z;if(-1===R)z=E;else{for(P=Math.max(S.length,P),z=[],b=0;b=R);b++)z.push(_);for(b=R;b=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||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function z(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=R(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function H(t,e,r){if(t=o.getGraphDiv(t),M.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Z(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(A.layoutReplot):Object.keys(n).length&&(q(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(A.doLegend),a.layoutstyle&&s.push(A.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(A.doTicksRelayout),a.modebar&&s.push(A.doModeBar),a.camera&&s.push(A.doCamera),a.colorbars&&s.push(A.doColorBars),s.push(L)),s.push(h.rehover,h.redrag),u.add(t,H,[t,i.undoit],H,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function q(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,A.doAutoRangeAndConstraints,r,A.drawData,A.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=j(l._preGUI,u),d=Object.keys(e),g=p.list(t),v=o.extendDeepAll({},e),m={};for(V(e),d=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[I];)I--;var D=P.parts[I],N=P.parts[I-1]+"."+D,B=P.parts.slice(0,I).join("."),U=s(t.layout,B).get(),H=s(l,B).get(),q=P.get();if(void 0!==z){A[R]=z,E[R]="reverse"===D?z:F(q);var G=f.getLayoutValObject(l,P.parts);if(G&&G.impliedEdits&&null!==z)for(var Z in G.impliedEdits)L(o.relativeAttr(R,Z),G.impliedEdits[Z]);if(-1!==["width","height"].indexOf(R))if(z){L("autosize",null);var K="height"===R?"width":"height";L(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)L("width",z?null:l.width),L("height",z?null:l.height);else if(N.match(X))O(N),s(l,B+"._inputRange").set(null);else if(N.match(W)){O(N),s(l,B+"._inputRange").set(null);var $=s(l,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(Y)&&s(l,B+"._inputDomain").set(null);if("type"===D){var J=U,tt="linear"===H.type&&"log"===z,et="log"===H.type&&"linear"===z;if(tt||et){if(J&&J.range)if(H.autorange)tt&&(J.range=J.range[1]>J.range[0]?[1,2]:[2,1]);else{var rt=J.range[0],nt=J.range[1];tt?(rt<=0&&nt<=0&&L(B+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),L(B+".range[0]",Math.log(rt)/Math.LN10),L(B+".range[1]",Math.log(nt)/Math.LN10)):(L(B+".range[0]",Math.pow(10,rt)),L(B+".range[1]",Math.pow(10,nt)))}else L(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,z,L),c.getComponentMethod("images","convertCoords")(t,H,z,L)}else L(B+".autorange",!0),L(B+".range",null);s(l,B+"._inputRange").set(null)}else if(D.match(k)){var it=s(l,R).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,L),c.getComponentMethod("images","convertCoords")(t,it,at,L)}var ot=w.containerArrayMatch(R);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(z)?E[R]=null:w.isRemoveVal(z)?E[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,lt),m[r]||(m[r]={});var ut=m[r][n];ut||(ut=m[r][n]={}),ut[st]=z,delete e[R]}else"reverse"===D?(U.range?U.range.reverse():(L(B+".autorange",!0),U.range=[1,0]),H.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===z||"select"===z)&&"lasso"!==q&&"select"!==q||l._has("gl2d")?_.plot=!0:G?T.update(_,G):_.calc=!0,P.set(z))}}for(r in m){w.applyContainerArrayChanges(t,h(a,r),m[r],_,h)||(_.plot=!0)}var ct=l._axisConstraintGroups||[];for(S in C)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,M.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&AA)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&E<5&&(E++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===E&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,a];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(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&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(!(i=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return x(i,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":506,"../plots/attributes":549}],543:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return a.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var A=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=M(c,A,c.side),c._mainMirrorPosition=c.mirror&&A?M(c,A,d.OPPOSITE_SIDE[c.side]):null}var T=[],k=[],E=[],L=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(i in v._plots)if((s=v._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var S=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(S,C,E)){var R=O.node(),P=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(P.node(),R.childNodes[0]),k.push(i)}else O.select("rect.bg").remove(),E.push([S,C]),L||(T.push(i),k.push(i))}var z,I,D,N,F,j,B,U,V,H,q,G,X,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eM?c.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=g(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&v(a)&&t(a,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":506,"../plots/attributes":549,"../plots/plots":597,"./plot_config":540,"./plot_schema":541,"./plot_template":542}],545:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(A);function L(){return new Promise((function(t){setTimeout(t,s.getDelay(A._fullLayout))}))}function S(){return new Promise((function(t,e){var r=l(A,y,_),n=A._fullLayout.width,f=A._fullLayout.height;function h(){i.purge(A),document.body.removeChild(A)}if("full-json"===y){var d=a.graphJson(A,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.plot(A,r,T,k).then(E).then(L).then(S).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":506,"../plots/plots":597,"../snapshot/helpers":610,"../snapshot/svgtoimg":612,"../snapshot/tosvg":614,"../version":682,"./plot_api":539,"fast-isnumeric":90}],546:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var T,k,E,L,S,C=b.length,O=Array.isArray(A);if(O&&(C=Math.min(C,A.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var R=b[k].length;for(T=0;T<(O?Math.min(R,A[k].length):R);T++)E=O?A[k][T]:A,L=y[k][T],S=b[k][T],n.validate(L,E)?S!==L&&S!==+L&&i.push(p("dynamic",a,m.concat(k,T),L,S)):i.push(p("value",a,m.concat(k,T),L))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&((x=T-o(v)-o(m))>k?_/x>L&&(y=v,b=m,L=_/x):_/T>L&&(y={val:v.val,pad:0},b={val:m.val,pad:0},L=_/T));if(h===d){var S=h-1,C=h+1;if(M)if(0===h)a=[0,1];else{var O=(h>0?f:c).reduce((function(t,e){return Math.max(t,o(e))}),0),R=h/(1-Math.min(.5,O/T));a=h>0?[0,R]:[R,0]}else a=A?[Math.max(0,S),Math.max(1,C)]:[S,C]}else M?(y.val>=0&&(y={val:0,pad:0}),b.val<=0&&(b={val:0,pad:0})):A&&(y.val-L*o(y)<0&&(y={val:0,pad:0}),b.val<=0&&(b={val:1,pad:0})),L=(b.val-y.val-E(v.val,m.val))/(T-o(y)-o(b)),a=[y.val-L*o(y),b.val+L*o(b)];return p&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function d(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,p,g,v,m=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,M=!1,A=r.vpadLinearized||!1;function T(t){if(Array.isArray(t))return M=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var k=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),S=T(r.vpadminus||r.vpad);if(!M){if(g=1/0,v=-1/0,w)for(i=0;i0&&(g=o),o>v&&o-a&&(g=o),o>v&&o=R;i--)O(i);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":485,"../../lib":506,"../../registry":606,"fast-isnumeric":90}],552:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),p=t("../../constants/numerical"),g=p.ONEAVGYEAR,v=p.ONEAVGMONTH,m=p.ONEDAY,y=p.ONEHOUR,b=p.ONEMIN,x=p.ONESEC,_=p.MINUS_SIGN,w=p.BADNUM,M=t("../../constants/alignment"),A=M.MID_SHIFT,T=M.CAP_SHIFT,k=M.LINE_SPACING,E=M.OPPOSITE_SIDE,L=e.exports={};L.setConvert=t("./set_convert");var S=t("./axis_autotype"),C=t("./axis_ids");L.id2name=C.id2name,L.name2id=C.name2id,L.cleanId=C.cleanId,L.list=C.list,L.listIds=C.listIds,L.getFromId=C.getFromId,L.getFromTrace=C.getFromTrace;var O=t("./autorange");L.getAutoRange=O.getAutoRange,L.findExtremes=O.findExtremes;function R(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}L.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},L.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=L.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},L.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:L.getFromId(e,r).cleanPos)(t)},L.redrawComponents=function(t,e){e=e||L.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},L.saveRangeInitial=function(t,e){for(var r=L.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=L.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=L.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=L.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,y,u,a)),v=b,0;v<=c;)v=L.tickIncrement(v,y,!1,a);return{start:e.c2r(b,0,a),end:e.c2r(v,0,a),size:y,_dataSpan:c-u}},L.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/i,L.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),q(t)},L.calcTicks=function(t,e){L.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=R(s.simpleMap(t.range,t.r2l)),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ca&&f=o:n<=o)&&!(u.length>r||n===e);n=L.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var i=!1;c&&n!==(0|n)&&(i=!0),u.push({minor:i,value:n})}}(),t.rangebreaks){var f=u.length;if(f){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var d,p=[],g=l?1:-1,v=l?f-1:0,m=l?0:f-1;g*m<=g*v;m+=g){var y=u[m];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var b=t.c2p(y.value);b===d?p[p.length-1].valueh)&&(d=b,p.push(y))}}u=p.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&a<=10||e>=15*m)t._tickround="d";else if(e>=b&&a<=16||e>=y)t._tickround="M";else if(e>=x&&a<=19||e>=b)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(W(t.exponentformat)&&!Y(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}L.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>g?(e/=g,r=n(10),t.dtick="M"+12*H(e,r,D)):a>v?(e/=v,t.dtick="M"+H(e,1,N)):a>m?(t.dtick=H(e,m,t._hasDayOfWeekBreaks?[1,2,7,14]:j),t.tick0=s.dateTick0(t.calendar,!0)):a>y?t.dtick=H(e,y,N):a>b?t.dtick=H(e,b,F):a>x?t.dtick=H(e,x,F):(r=n(10),t.dtick=H(e,r,D))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+H(e,r,D)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=H(e,r,V)):(t.tick0=0,r=n(10),t.dtick=H(e,r,D));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},L.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?U:B,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},L.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Z(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||W(d)&&Y(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":_)+h:(e.text=Z(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Z(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=Z(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=Z(e.x,t,i,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},L.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return L.hoverLabelText(t,e)+" - "+L.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=L.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+i:i};var X=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Y(t){return t>14||t<-15}function Z(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=L.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};q(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":W(l)&&(t+=X[u/3+5]));return a?_+t:t}function Q(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,f),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==h._dfltTitle[p]&&(n[l]+=$(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=f),!0===e.mirror||"ticks"===e.mirror?i[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Y&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,et(e),n),a.autoMargin(t,rt(e),i),a.autoMargin(t,nt(e),s)})),r.skipTitle||Y&&"bottom"===e.side||X.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+$(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,d=L.getPxPosition(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?d-r:d+r):(c=e._offset+e._length/2,l="right"===e.side?d+r:d-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(h={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var g=f.getTranslate(p.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(X)}}function Z(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=tt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},L.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},L.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},L.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},L.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,d,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(d="bottom"===t.side?1:-1,c=l*d,f=e+o*d,h="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+f+t.fontSize*h},p.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*d<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(d="right"===t.side?1:-1,c=o,f=-l*d,h=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*d},p.yFn=function(t){return t.dy+f+t.fontSize*A},p.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},L.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],K);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},L.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&L.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=i("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*b)||M)for(r=0;rP&&DO&&(O=D);d/=(O-C)/(2*R),C=u.l2r(C),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function F(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function j(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),B(t,e,i,a)}function B(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function U(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){C&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),C=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,S)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n){for(var i,a,o,l,u=!1,c={},f={},h=0;h=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(U(i),2!==t||pt||Ut(),dt)a.indexOf("select")>-1&&T(r,i,Z,Q,e.id,Lt),a.indexOf("event")>-1&&f.click(i,r,e.id);else if(1===t&&pt){var s=g?B:O,u="s"===g||"w"===C?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),d="left",p="middle";if(s.fixedrange)return;g?(p="n"===g?"top":"bottom","right"===s.side&&(d="right")):"e"===C&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(mt).call(l.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:p}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",i,c,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(J,e+yt)),i=Math.max(0,Math.min(tt,r+bt)),a=Math.abs(n-yt),o=Math.abs(i-bt);function s(){At="",xt.r=xt.l,xt.t=xt.b,kt.attr("d","M0,0Z")}if(xt.l=Math.min(yt,n),xt.r=Math.max(yt,n),xt.t=Math.min(bt,i),xt.b=Math.max(bt,i),et.isSubplotConstrained)a>S||o>S?(At="xy",a/J>o/tt?(o=a*tt/J,bt>i?xt.t=bt-o:xt.b=bt+o):(a=o*J/tt,yt>n?xt.l=yt-a:xt.r=yt+a),kt.attr("d",H(xt))):s();else if(rt.isSubplotConstrained)if(a>S||o>S){At="xy";var l=Math.min(xt.l/J,(tt-xt.b)/tt),u=Math.max(xt.r/J,(tt-xt.t)/tt);xt.l=l*J,xt.r=u*J,xt.b=(1-l)*tt,xt.t=(1-u)*tt,kt.attr("d",H(xt))}else s();else!it||og[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":506,"fast-isnumeric":90}],570:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":480}],571:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),M=t("../../plot_api/subroutines").redrawReglTraces,A=t("./constants"),T=A.MINSELECT,k=b.filter,E=b.tester,L=t("./handle_outline").clearSelect,S=t("./helpers"),C=S.p2r,O=S.axValue,R=S.getTransform;function P(t,e,r,n,i,a,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=m(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function j(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function U(t,e,r){var n,a,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!B){var r=Y.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&P(e,W,i.xaxes,i.yaxes,i.subplot,i,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},i.doneFn=function(){ft.remove(),x.done(ht).then((function(){x.clear(ht),i.gd.emit("plotly_selected",L),_&&i.selectionDefs&&(_.subtract=st,i.selectionDefs.push(_),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,b)),i.doneFnCompleted&&i.doneFnCompleted(dt)})).catch(y.error),B&&F(i)}},clearSelect:L,clearSelectionsCache:F,selectOnClick:P}},{"../../components/color":378,"../../components/dragelement/helpers":396,"../../components/drawing":400,"../../components/fx":418,"../../components/fx/helpers":414,"../../components/shapes/draw_newshape/display_outlines":463,"../../components/shapes/draw_newshape/helpers":464,"../../components/shapes/draw_newshape/newshapes":465,"../../lib":506,"../../lib/clear_gl_canvases":494,"../../lib/polygon":518,"../../lib/throttle":530,"../../plot_api/subroutines":543,"../../registry":606,"./axis_ids":555,"./constants":558,"./handle_outline":562,"./helpers":563,polybooljs:300}],572:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,b=t("./axis_ids"),x=t("./constants"),_=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function A(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function T(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*p*Math.abs(n-i))}return d}function k(e,r,n,o){var s=l(e,n||t.calendar);if(s===d){if(!i(e))return d;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function E(e,r,n){return s(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function S(e){if(A(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function C(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=C(t);return void 0!==e?e:i(t)?+t:void 0}function R(t,e,r){return n.round(r+e*t,2)}function P(t,e,r){return(t-r)/e}var z=function(e){return i(e)?R(e,t._m,t._b):d},I=function(e){return P(e,t._m,t._b)};if(t.rangebreaks){var D="y"===f;z=function(e){if(!i(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=D;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var f=t._B[s]||0;return isFinite(f)?R(e,t._m2,f):0},I=function(e){var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return P(e,t._m2,t._B[n])}}t.c2l="log"===t.type?T:u,t.l2c="log"===t.type?M:u,t.l2p=z,t.p2l=I,t.c2p="log"===t.type?function(t,e){return z(T(t,e))}:z,t.p2c="log"===t.type?function(t){return M(I(t))}:I,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=I,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return T(o(t),e)},t.r2d=t.r2c=function(t){return M(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=T,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(I(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=I,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=k,t.c2d=t.c2r=t.l2d=t.l2r=E,t.d2p=t.r2p=function(e,r,n){return t.l2p(k(e,0,n))},t.p2d=t.p2r=function(t,e,r){return E(I(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=S,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(I(t))},t.r2p=t.d2p,t.p2r=I,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=C,t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(I(t))},t.r2p=t.d2p,t.p2r=I,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=b.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),h="y"===f;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;si&&(i+=7,si&&(i+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),g=a.simpleMap(e.xr1,i.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),i.range[0]=i.l2r(p[0]*(1-r)+r*g[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?u/d[2]:1,M=h?c/d[3]:1,A=f?d[0]:0,T=h?d[1]:0,k=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,L=i._offset-k,S=l._offset-E;n.clipRect.call(o.setTranslate,A,T).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,S).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":400,"../../lib":506,"../../registry":606,"./axes":552,d3:81}],577:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var d=a(u),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":378,"../../../lib":506,"../../../registry":606,"../../get_data":582,"../../subplot_defaults":604,"./axis_defaults":586,"./layout_attributes":589}],589:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":506,"../../../lib/extend":500,"../../domain":579,"./axis_attributes":585}],590:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":528}],591:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c,{msUTC:!0}),p=0;p/g," "));l[u]=d,c.tickmode=f}}e.ticks=l;for(u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),b(e),e.glplot.axes.update(e.axesOptions);for(var s,l=Object.keys(e.traces),u=null,c=e.glplot.selection,p=0;p")):"isosurface"===t.type||"volume"===t.type?(w.valueLabel=h.tickText(e._mockAxis,e._mockAxis.d2l(c.traceCoordinate[3]),"hover").text,k.push("value: "+w.valueLabel),c.textLabel&&k.push(c.textLabel),y=k.join("
")):y=c.textLabel;var E={x:c.traceCoordinate[0],y:c.traceCoordinate[1],z:c.traceCoordinate[2],data:x._input,fullData:x,curveNumber:x.index,pointNumber:_};d.appendArrayPointValue(E,x,_),t._module.eventData&&(E=x._module.eventData(E,c,x,{},_));var L={points:[E]};e.fullSceneLayout.hovermode&&d.loneHover({trace:x,x:(.5+.5*m[0]/m[3])*a,y:(.5-.5*m[1]/m[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:y,name:u.name,color:d.castHoverOption(x,_,"bgcolor")||u.color,borderColor:d.castHoverOption(x,_,"bordercolor"),fontFamily:d.castHoverOption(x,_,"font.family"),fontSize:d.castHoverOption(x,_,"font.size"),fontColor:d.castHoverOption(x,_,"font.color"),nameLength:d.castHoverOption(x,_,"namelength"),textAlign:d.castHoverOption(x,_,"align"),hovertemplate:f.castOption(x,_,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,w),eventData:[E]},{container:n,gd:r}),c.buttons&&c.distance<5?r.emit("plotly_click",L):r.emit("plotly_hover",L),s=L}else d.loneUnhover(n),r.emit("plotly_unhover",s);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var M=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=M[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(c||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pv[1][a])v[0][a]=-1,v[1][a]=1;else{var S=v[1][a]-v[0][a];v[0][a]-=S/32,v[1][a]+=S/32}if("reversed"===s.autorange){var C=v[0][a];v[0][a]=v[1][a],v[1][a]=C}}else{var O=s.range;v[0][a]=s.r2l(O[0]),v[1][a]=s.r2l(O[1])}v[0][a]===v[1][a]&&(v[0][a]-=1,v[1][a]+=1),m[a]=v[1][a]-v[0][a],this.glplot.setBounds(a,{min:v[0][a]*h[a],max:v[1][a]*h[a]})}var R=u.aspectmode;if("cube"===R)g=[1,1,1];else if("manual"===R){var P=u.aspectratio;g=[P.x,P.y,P.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var I=y[l=(s=u[M[a]]).type];z[a]=Math.pow(I.acc,1/I.count)/h[a]}g="data"===R||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}u.aspectratio.x=c.aspectratio.x=g[0],u.aspectratio.y=c.aspectratio.y=g[1],u.aspectratio.z=c.aspectratio.z=g[2],this.glplot.setAspectratio(u.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=u.aspectmode);var D=u.domain||null,N=e._size||null;if(D&&N){var F=this.container.style;F.position="absolute",F.left=N.l+D.x[0]*N.w+"px",F.top=N.t+(1-D.y[1])*N.h+"px",F.width=N.w*(D.x[1]-D.x[0])+"px",F.height=N.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),u=this.isAspectChanged(t),h=l||u;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),u&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(u)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var u=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[u]=h;var p=n.layout;c.call("_storeDirectGUIEdit",p,i._preGUI,d),a.up=h,f.nestedProperty(p,u).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d"),u=l.createImageData(r,i);switch(u.data.set(a),l.putImageData(u,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[M[t]];h.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":418,"../../lib":506,"../../lib/show_no_webgl_msg":526,"../../lib/str2rgbarray":528,"../../plots/cartesian/axes":552,"../../registry":606,"./layout/convert":587,"./layout/spikes":590,"./layout/tick_marks":591,"./project":592,"gl-plot3d":142,"has-passive-events":249,"is-mobile":258,"webgl-context":359}],594:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a=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"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.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})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(f,s,c,i),y.cleanPlot(f,s,c,i);var F=!(!i._has||!i._has("gl2d")),j=!(!s._has||!s._has("gl2d")),B=!(!i._has||!i._has("cartesian"))||F,U=!(!s._has||!s._has("cartesian"))||j;B&&!U?i._bgLayer.remove():U&&!B&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&h({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=y.layoutAttributes.width.min,d=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:f,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),L(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,d=e.height,p=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in p)g[v]||delete p[v];for(var m in p.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},p){var b=p[m].l||{},x=p[m].b||{},_=b.val,w=b.size,M=x.val,A=x.size;for(var T in p){if(i(w)&&p[T].r){var k=p[T].r.val,E=p[T].r.size;if(k>_){var S=(w*k+(E-h)*_)/(k-_),C=(E*(1-_)+(w-h)*(1-k))/(k-_);S>=0&&C>=0&&h-(S+C)>0&&S+C>s+u&&(s=S,u=C)}}if(i(A)&&p[T].t){var O=p[T].t.val,R=p[T].t.size;if(O>M){var P=(A*O+(R-d)*M)/(O-M),z=(R*(1-M)+(A-d)*(1-O))/(O-M);P>=0&&z>=0&&d-(z+P)>0&&P+z>f+c&&(f=P,c=z)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(d)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var I=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return a.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return a.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(f.layout=c(s)),t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),u&&(f.frames=c(u)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},y.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,p[e]=a}}for(R(u,h,d),i=0;i=0?h.angularAxis.domain:n.extent(M),L=Math.abs(M[1]-M[0]);T&&!A&&(L=0);var S=E.slice();k&&A&&(S[1]+=L);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(S[1]-S[0])/C);var O=h.angularAxis.ticksStep||(S[1]-S[0])/(C*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var R=n.range.apply(this,S);if(R=R.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(S.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=k?L:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,D=t.select(".chart-group"),N={fill:"none",stroke:h.tickColor},F={"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){I=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var j=d.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:d.map((function(t,e){return t.name||"Element"+e})),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:I,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=I.node().getBBox();b=Math.min(h.width-B.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],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else I=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),D.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(F).text(h.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(N),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(N);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(N),q.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(F).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,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(R),Q=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),Q.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(N),Q.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(F);var K=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:a+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(F);h.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(D.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));I.attr({transform:"translate("+[b+$,h.margin.top]+")"});var J=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||J){var et=[];d.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.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 i(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});D.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});D.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(X).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};A&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)})),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).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},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return a.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)})),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a}))})),o=n.merge(a);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[a.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*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=i({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 a=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=i({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":480,"../../../lib":506,d3:81}],602:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":378,"../../../lib":506,"./micropolar":601,"./undo_manager":603,d3:81}],603:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":378,"../components/drawing":400,"../constants/xmlns_namespaces":486,"../lib":506,d3:81}],615:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],616:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;u=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":506}],621:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[a][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":506}],622:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;var u=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plot_api/edit_types":535,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],623:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function D(t,e){return null===t?e:t}function N(e,r,n){C();var i,a,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[d]:S(p,g,m);h[d]=b>-1?b:R(p,g,m,D(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++v}}function F(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function B(t){var e=.001*(L-E);return t>=E-e&&t<=L+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,i),j(e[1][3],n,i),j(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return B(e[0][3])&&B(e[1][3])&&B(e[2][3])?(N(t,e,r),!0):a<3&&V(t,e,r,E,L,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(h,c,n,i),p=F(h,f,n,i);o=l(t,[p,d,c],[-1,-1,r[a[0]]])||o,o=l(t,[c,f,p],[r[a[0]],r[a[1]],-1])||o,u=!0}})),u||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var c=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(f,c,n,i),p=F(h,c,n,i);o=l(t,[p,d,c],[-1,-1,r[a[0]]])||o,u=!0}})),o}function H(t,e,r,n){var i=!1,a=U(e),o=[j(a[0][3],r,n),j(a[1][3],r,n),j(a[2][3],r,n),j(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]];if(g)i=N(t,[u,c,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var d=F(h,u,r,n),p=F(h,c,r,n),v=F(h,f,r,n);i=N(null,[d,p,v],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(f,u,r,n),p=F(f,c,r,n),v=F(h,c,r,n),m=F(h,u,r,n);g?(i=N(t,[u,m,d],[e[l[0]],-1,-1])||i,i=N(t,[c,p,v],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,p,v,m],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=a[l[0]],c=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(c,u,r,n),p=F(f,u,r,n),v=F(h,u,r,n);g?(i=N(t,[u,d,p],[e[l[0]],-1,-1])||i,i=N(t,[u,p,v],[e[l[0]],-1,-1])||i,i=N(t,[u,v,d],[e[l[0]],-1,-1])||i):i=N(null,[d,p,v],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,u,c){var f=!1;return p&&(I(t,"A")&&(f=H(null,[e,r,n,a],u,c)||f),I(t,"B")&&(f=H(null,[r,n,i,l],u,c)||f),I(t,"C")&&(f=H(null,[r,a,o,l],u,c)||f),I(t,"D")&&(f=H(null,[n,a,s,l],u,c)||f),I(t,"E")&&(f=H(null,[r,n,a,l],u,c)||f)),g&&(f=H(t,[r,n,a,l],u,c)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function X(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,u,c,f=!1,h=function(){f=V(t,[s,l,u],[-1,-1,-1],i,a)||f,f=V(t,[u,c,s],[-1,-1,-1],i,a)||f},d=o[0],p=o[1],g=o[2];return d&&(s=P(U([A(e,r-0,n-0)])[0],U([A(e-1,r-0,n-0)])[0],d),l=P(U([A(e,r-0,n-1)])[0],U([A(e-1,r-0,n-1)])[0],d),u=P(U([A(e,r-1,n-1)])[0],U([A(e-1,r-1,n-1)])[0],d),c=P(U([A(e,r-1,n-0)])[0],U([A(e-1,r-1,n-0)])[0],d),h()),p&&(s=P(U([A(e-0,r,n-0)])[0],U([A(e-0,r-1,n-0)])[0],p),l=P(U([A(e-0,r,n-1)])[0],U([A(e-0,r-1,n-1)])[0],p),u=P(U([A(e-1,r,n-1)])[0],U([A(e-1,r-1,n-1)])[0],p),c=P(U([A(e-1,r,n-0)])[0],U([A(e-1,r-1,n-0)])[0],p),h()),g&&(s=P(U([A(e-0,r-0,n)])[0],U([A(e-0,r-0,n-1)])[0],g),l=P(U([A(e-0,r-1,n)])[0],U([A(e-0,r-1,n-1)])[0],g),u=P(U([A(e-1,r-1,n)])[0],U([A(e-1,r-1,n-1)])[0],g),c=P(U([A(e-1,r-0,n)])[0],U([A(e-1,r-0,n-1)])[0],g),h()),f}function Y(t,e,r,n,i,a,o,s,l,u,c,f){var h=t;return f?(p&&"even"===t&&(h=null),q(h,e,r,n,i,a,o,s,l,u,c)):(p&&"odd"===t&&(h=null),q(h,l,s,o,a,i,n,r,e,u,c))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(p-k)?[T,p]:[p,k];J(e,M[0],M[1])}}var S=[[Math.min(E,k),Math.max(E,k)],[Math.min(T,L),Math.max(T,L)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(c.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);c.length>0&&(r[i]="x"===e?tt(null,c,a,o,f,r[i]):"y"===e?et(null,c,a,o,f,r[i]):rt(null,c,a,o,f,r[i]),i++),u.length>0&&(r[i]="x"===e?Z(null,u,a,o,r[i]):"y"===e?Q(null,u,a,o,r[i]):K(null,u,a,o,r[i]),i++)}var p=t.caps[e];p.show&&p.fill&&(z(p.fill),r[i]="x"===e?Z(null,[0,x-1],a,o,r[i]):"y"===e?Q(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===v&&O(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":390,"../../lib/gl_format_color":504,"../../lib/str2rgbarray":528,"../../plots/gl3d/zip3":594,"gl-mesh3d":139}],625:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=a("x"),c=a("y"),f=a("z"),h=a("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":388,"../../lib":506,"../../registry":606,"./attributes":622}],626:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":583,"./attributes":622,"./calc":623,"./convert":624,"./defaults":625}],627:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../surface/attributes":673}],628:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":386}],629:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!v(t.i,f)||!v(t.j,f)||!v(t.k,f))return;n=c(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;os&&T[v].gap;)v--;for(y=T[v].s,p=T.length-1;p>v;p--)T[p].s=y;for(;sk[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],642:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=u(t,e,g,v),b=!y&&mG!=(N=R[C][1])>=G&&(z=R[C-1][0],I=R[C][0],N-D&&(P=z+(I-z)*(G-D)/(N-D),U=Math.min(U,P),V=Math.max(V,P)));U=Math.max(U,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:G,y1:G,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":378,"../../components/fx":418,"../../lib":506,"../../registry":606,"./get_trace_color":645}],647:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":565,"./arrays_to_calcdata":634,"./attributes":635,"./calc":636,"./cross_trace_calc":640,"./cross_trace_defaults":641,"./defaults":642,"./format_labels":644,"./hover":646,"./marker_colorbar":653,"./plot":655,"./select":656,"./style":658,"./subtypes":659}],648:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":388,"../../components/colorscale/helpers":389,"../../lib":506}],649:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,d,p,g,v,m,y,b,x,_,w,M,A,T,k,E=e.xaxis,L=e.yaxis,S="log"===E.type,C="log"===L.type,O=E._length,R=L._length,P=e.connectGaps,z=e.baseTolerance,I=e.shape,D="linear"===I,N=e.fill&&"none"!==e.fill,F=[],j=f.minTolerance,B=t.length,U=new Array(B),V=0;function H(r){var n=t[r];if(!n)return!1;var a=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?L.l2p(n.y):L.c2p(n.y);if(a===i){if(S&&(a=E.c2p(n.x,!0)),a===i)return!1;C&&l===i&&(a*=Math.abs(E._m*R*(E._m>0?o:s)/(L._m*O*(L._m>0?o:s)))),a*=1e3}if(l===i){if(C&&(l=L.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,Q]),ut(t),K=null,Z=Q=0}function ft(t){if(T=t[0]/O,k=t[1]/R,W=t[0]rt?rt:0,Y=t[1]it?it:0,W||Y){if(V)if(K){var e=J(K,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else $=J(U[V-1],t)[0],U[V++]=$;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?(K&&(Z!==W&&Q!==Y?ut(Z&&Q?(n=K,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||W,Q||Y]):Z&&Q&&ut([Z,Q])),ut([W,Y])):Z-W&&Q-Y&&ut([W||Z,Y||Q]),K=t,Z=W,Q=Y}else K&&ct(J(K,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===I||"spline"===I?J=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)G(p,ht))break;a=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}K&&ut([Z||K[0],Q||K[1]]),F.push(U.slice(0,V))}return F}},{"../../constants/numerical":485,"../../lib":506,"./constants":639}],650:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],651:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(a=0;a=0?l=d:(l=d=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":90}],653:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],654:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":378,"../../components/colorscale/defaults":388,"../../components/colorscale/helpers":389,"./subtypes":659}],655:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),A=o(M,"g","errorbars"),T=o(M,"g","lines"),k=o(M,"g","points"),E=o(M,"g","text");if(i.getComponentMethod("errorbars","plot")(t,A,r,g),!0===_.visible){var L,S;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,P="",z=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",S=I._nextFill,z=I._polygons);var D,N,F,j,B,U,V,H="",q="",G=[],X=a.noop;if(L=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(S&&S.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(D=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):D=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var W=T.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(L?(L.datum(f),j&&U&&(C?("y"===C?j[1]=U[1]=x.c2p(0,!0):"x"===C&&(j[0]=U[0]=b.c2p(0,!0)),y(L).attr("d","M"+U+"L"+j+"L"+H.substr(1)).call(l.singleFillStyle)):y(L).attr("d",H+"Z").call(l.singleFillStyle))):S&&("tonext"===_.fill.substr(0,6)&&H&&P?("tonext"===_.fill?y(S).attr("d",H+"Z"+P+"Z").call(l.singleFillStyle):y(S).attr("d",H+"L"+P.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(z)):(Z(S),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(L?Z(L):S&&Z(S),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),E.datum(f),function(e,i,a){var o,c=a[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?K:Q:_&&!w&&(v=$),f&&(p=v),h&&(g=v)}var M,A=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&A.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(c)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,c,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function Q(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function J(t){return t.id}function tt(t){if(t.ids)return J}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,p=!a,g=!!a&&a.duration>0,v=f(t,e,r);((c=i.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,a)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,a)}));p&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":400,"../../lib":506,"../../lib/polygon":518,"../../registry":606,"./line_points":649,"./link_traces":651,"./subtypes":659,d3:81}],656:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":506,"../../registry":606,"../scatter/line_defaults":648,"../scatter/marker_defaults":654,"../scatter/subtypes":659,"../scatter/text_defaults":660,"./attributes":662}],667:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":483,"../../plots/gl3d":583,"./attributes":662,"./calc":663,"./convert":665,"./defaults":666}],668:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":385,"../../lib/extend":500,"../../plots/attributes":549,"../../plots/template_attributes":605,"../mesh3d/attributes":627}],669:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/calc");function a(t){var e,r,i,a,s,l,u,c,f,h,d,p,g=t._x,v=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,A=1/0,T="";for(y&&(u=g[0],f=v[0],d=m[0]),y>1&&(c=g[y-1],h=v[y-1],p=m[y-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var S=function(){y=0,k=[],E=[],L=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function p(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var g=p(e._Xs,"xaxis"),v=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[g,v,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=v[0],b=h(g),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=g[n];break}return r}function b(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;aw;)r--,r/=y(r),++r<_&&(r=w);var n=Math.round(r/t);return n>1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,f=i(new Float32Array(u*c),[u,c]),h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e] 0) { var factor = 1 - 2 * frameMargins; @@ -80835,7 +80844,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[5])(5) }); diff --git a/dist/plotly-mapbox.min.js b/dist/plotly-mapbox.min.js index 9fe3114c760..7b81ce85fb2 100644 --- a/dist/plotly-mapbox.min.js +++ b/dist/plotly-mapbox.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (mapbox - minified) v1.54.2 +* plotly.js (mapbox - minified) v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -18,4 +18,4 @@ * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,p=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=i():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return p.epsilon(t)},segments:function(t){var e=o(!0,p,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,p,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,p,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,p,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":26,"./lib/epsilon":27,"./lib/geojson":28,"./lib/intersecter":29,"./lib/segment-chainer":31,"./lib/segment-selector":32}],26:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],27:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],28:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}a.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var f,d,m;return a=L(a),{ok:p,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(O(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*E(this._r,255))+"%",g:a(100*E(this._g,255))+"%",b:a(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%)":"rgba("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function E(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,U=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!U.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],35:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],36:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":212,"../../plots/cartesian/constants":228,"../../plots/font_attributes":250,"./arrow_paths":35}],37:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],p=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":178,"../../plots/cartesian/axes":222,"./draw":42}],38:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Z=!1,G=["x","y"],H=0;H1)&&(tt===$?((ut=et.r2fraction(e["a"+Q]))<0||ut>1)&&(Z=!0):Z=!0),X=et._offset+et.r2p(e[Q]),K=.5}else"x"===Q?(Y=e[Q],X=x.l+x.w*Y):(Y=1-e[Q],X=x.t+x.h*Y),K=e.showarrow?.5:Y;if(e.showarrow){lt.head=X;var ct=e["a"+Q];J=nt*j(.5,e.xanchor)-it*j(.5,e.yanchor),tt===$?(lt.tail=et._offset+et.r2p(ct),W=J):(lt.tail=X+ct,W=J+ct),lt.text=lt.tail+J;var pt=_["x"===Q?"width":"height"];if("paper"===$&&(lt.head=o.constrain(lt.head,1,pt-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),ft=Math.min(lt.tail+3,lt.text)-pt;ht>0?(lt.tail+=ht,lt.text+=ht):ft>0&&(lt.tail-=ft,lt.text-=ft)}lt.tail+=st,lt.head+=st}else W=J=at*j(K,ot),lt.text=X+J;lt.text+=st,J+=st,W+=st,e["_"+Q+"padplus"]=at/2+W,e["_"+Q+"padminus"]=at/2-W,e["_"+Q+"size"]=at,e["_"+Q+"shift"]=J}if(Z)P.remove();else{var dt=0,mt=0;if("left"!==e.align&&(dt=(w-g)*("center"===e.align?.5:1)),"top"!==e.valign&&(mt=(I-v)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:R+dt-1,y:R+mt}).call(u.setClipUrl,B?M:null,t);else{var yt=R+mt-d.top,gt=R+dt-d.left;V.call(p.positionText,gt,yt).call(u.setClipUrl,B?M:null,t)}N.select("rect").call(u.setRect,R,R,w,I),F.call(u.setRect,D/2,D/2,O-D,U-D),P.call(u.setTranslate,Math.round(S.x.text-O/2),Math.round(S.y.text-U/2)),E.attr({transform:"rotate("+C+","+S.x.text+","+S.y.text+")"});var vt,_t=function(r,n){L.selectAll(".annotation-arrow-g").remove();var c=S.x.head,p=S.y.head,h=S.x.tail+r,d=S.y.tail+n,g=S.x.text+r,v=S.y.text+n,_=o.rotationXYMatrix(C,g,v),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),z=+F.attr("width"),I=+F.attr("height"),D=g-.5*z,O=D+z,R=v-.5*I,B=R+I,N=[[D,R,D,B],[D,B,O,B],[O,B,O,R],[O,R,D,R]].map(M);if(!N.reduce((function(t,e){return t^!!o.segmentsIntersect(c,p,c+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){N.forEach((function(t){var e=o.segmentsIntersect(h,d,c,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var U=e.arrowwidth,j=e.arrowcolor,V=e.arrowside,q=L.append("g").style({opacity:l.opacity(j)}).classed("annotation-arrow-g",!0),Z=q.append("path").attr("d","M"+h+","+d+"L"+c+","+p).style("stroke-width",U+"px").call(l.stroke,l.rgb(j));if(m(Z,V,e),b.annotationPosition&&Z.node().parentNode&&!a){var G=c,H=p;if(e.standoff){var X=Math.sqrt(Math.pow(c-h,2)+Math.pow(p-d,2));G+=e.standoff*(h-c)/X,H+=e.standoff*(d-p)/X}var W,Y,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(d-H),transform:"translate("+G+","+H+")"}).style("stroke-width",U+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);W=t.x,Y=t.y,s&&s.autorange&&T(s._name+".autorange",!0),y&&y.autorange&&T(y._name+".autorange",!0)},moveFn:function(t,r){var n=w(W,Y),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),k("y",y?y.p2r(y.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",y.p2r(y.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),E.attr({transform:"rotate("+C+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&_t(0,0),z)f.init({element:P.node(),gd:t,prepFn:function(){vt=E.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",y.p2r(y.r2p(e.ay)+r)):k("ay",e.ay+r),_t(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=f.align(u+t/x.w,l,0,1,e.xanchor)}if(y)o=y.p2r(y.r2p(e.y)+r);else{var c=e._ysize/x.h,p=e.y-(e._yshift+e.yshift)/x.h-c/2;o=f.align(p-r/x.h,c,0,1,e.yanchor)}k("x",i),k("y",o),s&&y||(n=f.getCursor(s?.5:i,y?.5:o,e.xanchor,e.yanchor))}E.attr({transform:"translate("+t+","+r+")"+vt}),h(P,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){h(P),i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,g=p.backoff*f+r.standoff,v=h.backoff*d+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var _=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,_))+Math.PI,g&&v&&g+v>Math.sqrt(_*_+x*x))return void z();if(g){if(g*g>_*_+x*x)return void z();var b=g*Math.cos(l),w=g*Math.sin(l);s.x+=b,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(v){if(v*v>_*_+x*x)return void z();var T=v*Math.cos(l),k=v*Math.sin(l);o.x-=T,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var A=c.getTotalLength(),M="";if(A1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":253,"../annotations/draw":42}],49:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Y=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));H*=Y*u.roundUp(W/Y,[2,5,10]),(Math.abs(L.start)/L.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=H}G.domain=[V+N,V+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var K,J=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),Q=t.select("."+k.cbaxis),$=0;function tt(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===A?(1-(V+R-N))*l.h+l.t+3+.75*n:(1-(V+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var a=t.select("."+k.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],p=a.select(".h"+G._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*b),p?($=h.bBox(p).height)>f&&(c[1]-=($-f)/2):o.node()&&!o.classed(k.jsPlaceholder)&&($=h.bBox(o.node()).height),$){if($+=5,"top"===A)G.domain[1]-=$/l.h,c[1]*=-1;else{G.domain[0]+=$/l.h;var d=m.lineCount(o);c[1]+=(1-d)*f}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-l.t)+")");var g=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(z);g.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),g.exit().remove();var v=M.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));g.each((function(t,a){var o=[0===a?M[0]:(z[a]+z[a-1])/2,a===z.length-1?M[1]:(z[a]+z[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,v[0],v[1]);var s=n.select(this).attr({x:U,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=C(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var _=t.select("."+k.cblines).selectAll("path."+k.cbline).data(y.color&&y.width?I:[]);_.enter().append("path").classed(k.cbline,!0),_.exit().remove(),_.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(G.c2p(t))+y.width/2%1)+"h"+P).call(h.lineGroupStyle,y.width,S(t),y.dash)})),Q.selectAll("g."+G._id+"tick,path").remove();var x=U+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),T=s.makeTransFn(G),L=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:Q,path:s.makeTickPath(G,x,L),transFn:T}),s.drawLabels(r,G,{vals:w,layer:Q,transFn:T,labelFns:s.makeLabelFns(G,x)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=P+e.outlinewidth/2+h.bBox(Q.node()).width;if((K=J.select("text")).node()&&!K.classed(k.jsPlaceholder)){var i,o=J.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(A)?h.bBox(o).width:h.bBox(J.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=q-Z;t.select("."+k.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:Z-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(f.fill,e.bgcolor).call(f.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:U,y:Z+e.ypad+("top"===A?$:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-$,2)}).call(f.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var p={},d=w[e.yanchor],m=T[e.yanchor];"pixels"===e.lenmode?(p.y=e.y,p.t=u*d,p.b=u*m):(p.t=p.b=0,p.yt=e.y+e.len*d,p.yb=e.y-e.len*m);var y=w[e.xanchor],g=T[e.xanchor];if("pixels"===e.thicknessmode)p.x=e.x,p.l=s*y,p.r=s*g;else{var v=s-P;p.l=v*y,p.r=v*g,p.xl=e.x-e.thickness*y,p.xr=e.x+e.thickness*g}a.autoMargin(r,e._id,p)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),p(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);p(t,u)},doneFn:function(){if(p(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":153,"../../lib":178,"../../lib/extend":171,"../../lib/setcursor":197,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":263,"../../registry":272,"../color":51,"../colorscale/helpers":62,"../dragelement":70,"../drawing":73,"../titles":146,"./constants":53,d3:14,tinycolor2:34}],56:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":178}],57:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":52,"./defaults":54,"./draw":55,"./has_colorbar":56}],58:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var f=s+"auto",d=s+"min",m=s+"max",y=s+"mid",g=(o(h+f),o(h+d),o(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":193,"../colorbar/attributes":52,"./scales.js":66}],59:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,p=a(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return i.aggNums(Math.min,null,l)},g=function(){return i.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":178,"./helpers":62,"fast-isnumeric":16}],60:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],68:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":178}],69:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],70:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":178,"../../plots/cartesian/constants":228,"./align":67,"./cursor":68,"./unhover":71,"has-hover":18,"has-passive-events":19,"mouse-event-offset":23}],71:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":169,"../../lib/events":170,"../../lib/throttle":200,"../fx/constants":85}],72:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],73:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,f=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,g=e.exports={};g.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},g.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},g.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},g.setRect=function(t,e,r,n,i){t.call(g.setPosition,e,r).call(g.setSize,n,i)},g.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},g.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);g.translatePoint(t,i,e,r)}))},g.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},g.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){g.hideOutsideRangePoint(t,n.select(this),r,i,s,l)}))}))}},g.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},g.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),g.dashLine(e,l,o)},g.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(g.dashLine,l,o)}))},g.dashLine=function(t,e,r){r=+r||0,e=g.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},g.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},g.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},g.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var v=t("./symbol_defs");g.symbolNames=[],g.symbolFuncs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(v).forEach((function(t){var e=v[t],r=e.n;g.symbolList.push(r,t,r+100,t+"-open"),g.symbolNames[r]=t,g.symbolFuncs[r]=e.f,e.needLine&&(g.symbolNeedLines[r]=!0),e.noDot?g.symbolNoDot[r]=!0:g.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(g.symbolNoFill[r]=!0)}));var _=g.symbolNames.length;function x(t,e){var r=t%100;return g.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}g.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=g.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var b={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:b},horizontalreversed:{node:"linearGradient",attrs:b,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};g.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=k[i],h=new Array(c),f=0;f"+g(t);d._gradientUrlQueryParts[v]=1},g.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},g.pointStyle=function(t,e,r){if(t.size()){var i=g.makePointStyleFns(e);t.each((function(t){g.singlePointStyle(t,n.select(this),e,i,r)}))}},g.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=g.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var p,h,f,d=!1;if(t.so)f=o.outlierwidth,h=o.outliercolor,p=a.outliercolor;else{var m=(o||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(p=s.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var y=a.gradient,v=t.mgt;if(v?d=!0:v=y&&y.type,Array.isArray(v)&&(v=v[0],k[v]||(v=0)),v&&"none"!==v){var _=t.mgc;_?d=!0:_=y.color;var b=r.uid;d&&(b+="-"+t.i),g.gradient(e,i,b,v,[[0,_],[1,p]],"fill")}else s.fill(e,p);f&&s.stroke(e,h)}},g.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=g.tryColorscale(r,""),e.lineScale=g.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,g.makeSelectedPointStyleFns(t)),e},g.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,p=s.opacity,h=void 0!==c,d=void 0!==p;(u.isArrayOrTypedArray(l)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?p:f*e});var m=i.color,y=a.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?y||e:g||e});var v=i.size,_=a.size,x=s.size,b=void 0!==_,w=void 0!==x;return o.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},g.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,f))},e},g.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(g.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}g.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=g.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var p=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};y(h,e,t.i);var f=e._meta||{};l=u.texttemplateString(l,p,s._d3locale,h,t,f)}var d=t.tp||e.textposition,m=S(t,e),v=i?i(t):t.tc||e.textfont.color;a.call(g.font,t.tf||e.textfont.family,m,v).text(l).call(c.convertToTspans,r).call(M,d,m,t.mrc)}else a.remove()}))}},g.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(i,a),M(i,o,l,t.mrc2||t.mrc)}))}};function C(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),p=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}g.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(g.savedBBoxes={},z=0),r&&(g.savedBBoxes[r]=y),z++,u.extendFlat({},y)},g.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},g.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},g.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},g.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},g.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var D=/\s*sc.*/;g.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(D,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var O=/translate\([^)]*\)\s*$/;g.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(O);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":87,"../../constants/alignment":153,"../../constants/interactions":155,"../../constants/xmlns_namespaces":157,"../../lib":178,"../../lib/svg_text_utils":199,"../../registry":272,"../../traces/scatter/make_bubble_size_func":320,"../../traces/scatter/subtypes":327,"../color":51,"../colorscale":63,"./symbol_defs":74,d3:14,"fast-isnumeric":16,tinycolor2:34}],74:[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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:14}],75:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],76:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var p=d.width;a="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(a+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(f.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(f.copy_ystyle?d:f).width;a="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(a+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":327,"../drawing":73,d3:14,"fast-isnumeric":16}],81:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":51,d3:14}],82:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":171,"../../plots/font_attributes":250,"./layout_attributes":92}],83:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=$+x[0]._offset,e.pointerY=tt+w[0]._offset,D="xval"in e?m.flat(l,e.xval):m.p2c(x,$),O="yval"in e?m.flat(l,e.yval):m.p2c(w,tt),!i(D[0])||!i(O[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(F=0;FH&&(Y.splice(0,H),rt=Y[0].distance),g&&0!==W&&0===Y.length){G.distance=W,G.index=!1;var h=N._module.hoverPoints(G,q,Z,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=W}))),h&&h.length){var f,d=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var y=d[0];i(y.x0)&&i(y.y0)&&(f=at(y),(!J.vLinePoint||J.vLinePoint.spikeDistance>f.spikeDistance)&&(J.vLinePoint=f))}var v=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var _=v[0];i(_.x0)&&i(_.y0)&&(f=at(_),(!J.hLinePoint||J.hLinePoint.spikeDistance>f.spikeDistance)&&(J.hLinePoint=f))}}}}}function it(t,e){for(var r,n=null,i=1/0,a=0;a1||Y.length>1)||"closest"===L&&Q&&Y.length>1,At=p.combine(c.plot_bgcolor||p.background,c.paper_bgcolor),Mt={hovermode:L,rotateLabels:kt,bgColor:At,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},St=C(Y,Mt,t);m.isUnifiedHover(L)||(!function(t,e,r){var n,i,a,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?b:1)/2,pmin:0,pmax:i?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(a=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=a;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var w=x[s],T=w.datum;T.offset=w.dp,T.del=w.del}}}(St,kt?"xa":"ya",c),E(St,kt));if(e.target&&e.target.tagName){var Ct=d.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),Ct?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,_t))return;_t&&t.emit("plotly_unhover",{event:e,points:_t});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:D,yvals:O})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map((function(t){return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:a,outerContainer:o},l=C(i,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function C(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,f=e.outerContainer,d=e.commonLabelOpts||{},x=e.fontFamily||y.HOVERFONT,b=e.fontSize||y.HOVERFONTSIZE,w=t[0],T=w.xa,S=w.ya,C="y"===a.charAt(0)?"yLabel":"xLabel",E=w[C],z=(String(E)||"").split(" ")[0],I=f.node().getBoundingClientRect(),P=I.top,D=I.width,O=I.height,R=void 0!==E&&w.distance<=e.hoverdistance&&("x"===a||"y"===a);if(R){var F,B,N=!0;for(F=0;Fi.width-C?(g=i.width-C,s.attr("d","M"+(C-k)+",0L"+C+","+M+k+"v"+M+(2*A+_.height)+"H-"+C+"V"+M+k+"H"+(C-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(A+_.width/2)+"v"+M+(2*A+_.height)+"H-"+(A+_.width/2)+"V"+M+k+"H-"+k+"Z")}else{var L,z,I;"right"===S.side?(L="start",z=1,I="",g=T._offset+T._length):(L="end",z=-1,I="-",g=T._offset),v=S._offset+(w.y0+w.y1)/2,u.attr("text-anchor",L),s.attr("d","M0,0L"+I+k+","+k+"V"+(A+_.height/2)+"h"+I+(2*A+_.width)+"V-"+(A+_.height/2)+"H"+I+k+"V-"+k+"Z");var D,O=_.height/2,R=P-_.top-O,F="clip"+i._uid+"commonlabel"+S._id;if(g<_.width+2*A+k){D="M-"+(k+A)+"-"+O+"h-"+(_.width-A)+"V"+O+"h"+(_.width-A)+"Z";var B=_.width-g+A;l.positionText(u,B,R),"end"===L&&u.selectAll("tspan").each((function(){var t=n.select(this),e=c.tester.append("text").text(t.text()).call(c.font,y),r=e.node().getBoundingClientRect();Math.round(r.width)=0?$-=rt:$+=2*A;var nt=et.height+2*A,it=Q+nt>=O;return nt<=O&&(Q<=P?Q=S._offset+2*A:it&&(Q=O-nt)),tt.attr("transform","translate("+$+","+Q+")"),tt}var at=h.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return at.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(p.fill,p.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,b)})),at.exit().remove(),at.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=p.combine(p.opacity(o)?o:p.defaultLine,u),f=p.combine(p.opacity(t.color)?t.color:p.defaultLine,u),d=t.borderColor||p.contrast(h),m=L(t,R,a,i,E,e),y=m[0],g=m[1],v=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||b,t.fontColor||d).text(y).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),T=0,M=0;if(g&&g!==y){w.call(c.font,t.fontFamily||x,t.fontSize||b,f).text(g).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var S=w.node().getBoundingClientRect();T=S.width+2*A,M=S.height+2*A}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:d});var C,z,I=v.node().getBoundingClientRect(),F=t.xa._offset+(t.x0+t.x1)/2,B=t.ya._offset+(t.y0+t.y1)/2,N=Math.abs(t.x1-t.x0),U=Math.abs(t.y1-t.y0),j=I.width+k+A+T;if(t.ty0=P-I.top,t.bx=I.width+2*A,t.by=Math.max(I.height+2*A,M),t.anchor="start",t.txwidth=I.width,t.tx2width=T,t.offset=0,s)t.pos=F,C=B+U/2+j<=O,z=B-U/2-j>=0,"top"!==t.idealAlign&&C||!z?C?(B+=U/2,t.anchor="start"):t.anchor="middle":(B-=U/2,t.anchor="end");else if(t.pos=B,C=F+N/2+j<=D,z=F-N/2-j>=0,"left"!==t.idealAlign&&C||!z)if(C)F+=N/2,t.anchor="start";else{t.anchor="middle";var V=j/2,q=F+V-D,Z=F-V;q>0&&(F-=q),Z<0&&(F+=-Z)}else F-=N/2,t.anchor="end";v.attr("text-anchor",t.anchor),T&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+F+","+B+")"+(s?"rotate("+_+")":""))})),at}function L(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=D(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===i?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,p=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,p,u,h,t.trace._meta)).replace(S,(function(e,r){return s=D(r,t.nameLength),""}))),[l,s]}function E(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(k+A),p=u+s*(t.txwidth+A),h=0,f=t.offset;"middle"===a&&(u-=t.tx2width/2,p+=t.txwidth/2+A),e&&(f*=-T,h=t.offset*w),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(f-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+h)+","+(k+f)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+h)+"V"+(f-k)+"Z");var d=u+h,m=f+t.ty0-t.by/2+A,y=t.textAlign||"auto";"auto"!==y&&("left"===y&&"start"!==a?(i.attr("text-anchor","start"),d="middle"===a?-t.bx/2-t.tx2width/2+A:-t.bx-A):"right"===y&&"end"!==a&&(i.attr("text-anchor","end"),d="middle"===a?t.bx/2-t.tx2width/2-A:t.bx+A)),i.call(l.positionText,d,m),t.tx2width&&(r.select("text.name").call(l.positionText,p+s*A+h,f+t.ty0-t.by/2+A),r.select("rect").call(c.setRect,p+(s-1)*t.tx2width/2+h,f-t.by/2-1,t.tx2width,t.by+2))}))}function z(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:f.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:f.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=f.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+f.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=f.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+f.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function I(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||h){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=i._offset+v.y);var _,x,b=a.readability(v.color,m)<1.5?p.contrast(m):v.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||b,A=f.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=A,x=y),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),_=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":c.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(d){var C,L,E=e.vLinePoint;n=E&&E.xa,i=E&&E.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+E.x,L=i._offset+E.y);var z,I,P=a.readability(E.color,m)<1.5?p.contrast(m):E.color,D=n.spikemode,O=n.spikethickness,R=n.spikecolor||P,F=f.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(z=F,I=L),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),z=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:I,"stroke-width":O,stroke:R,"stroke-dasharray":c.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:I,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function P(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function D(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":178,"../../lib/events":170,"../../lib/override_cursor":189,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":272,"../color":51,"../dragelement":70,"../drawing":73,"../legend/defaults":103,"../legend/draw":104,"./constants":85,"./helpers":87,d3:14,"fast-isnumeric":16,tinycolor2:34}],89:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":178,"../color":51,"./helpers":87}],90:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}var o,s=a("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1!==m||u.uirevision){var y=a.newContainer(e,"legend");if(b("uirevision",e.uirevision),!1!==m){b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),i.coerceFont(b,"font",e.font);var g,v,_,x=b("orientation");"h"===x?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(g=1.02,v=1,_="auto"),b("traceorder",h),l.isGrouped(e.legend)&&b("tracegroupgap"),b("itemsizing"),b("itemclick"),b("itemdoubleclick"),b("x",g),b("xanchor"),b("y",v),b("yanchor",_),b("valign"),i.noneOrAll(u,y,["x","y"]),b("title.text")&&(b("title.side","h"===x?"left":"top"),i.coerceFont(b,"title.font",e.font))}}function b(t,e){return i.coerce(u,y,o,t,e)}}},{"../../lib":178,"../../plot_api/plot_template":212,"../../plots/layout_attributes":254,"../../registry":272,"./attributes":101,"./helpers":107}],104:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a=t.data()[0][0],s=a.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,d=r._maxNameLength;r.entries?n=a.text:(n=l?a.label:s.name,s._meta&&(n=i.templateString(n,s._meta)));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?T(n,d):n),p.positionText(m,f.textGap,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var s=a.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),p=u[u.length-1],h=i.keyedContainer(s,"transforms["+p+"].styles","target","value.name");h.set(a.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):A(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}}))}function A(t,e,r,n){n._main||t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),a=i.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*m;if(a){var h=u.bBox(a);o=h.height,s=h.width,n?u.setTranslate(i,0,.25*o):u.setTranslate(i,l,.75*o+l)}else{var d=t.select(n?".legendtext":".legendtitletext"),y=p.lineCount(d),g=d.node();o=c*y,s=g?u.bBox(g).width:0;var v=c*((y-1)/2-.3);n?p.positionText(d,f.textGap,-v):p.positionText(d,f.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,p="legend"+s._uid;if(e?(r=e.layer,p+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&v(t.calcdata,e)}else{if(!e.entries)return;h=v(e.entries,e)}var d=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+p).remove(),a.autoMargin(t,"legend");var m=i.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=i.ensureSingleById(s._topdefs,"clipPath",p,(function(t){t.append("rect")})),C=i.ensureSingle(m,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var L=i.ensureSingle(m,"g","scrollbox"),E=e.title;if(e._titleWidth=0,e._titleHeight=0,E.text){var z=i.ensureSingle(L,"text","legendtitletext");z.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,E.font).text(E.text),A(z,L,t,e)}else L.selectAll(".legendtitletext").remove();var I=i.ensureSingle(m,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),P=L.selectAll("g.groups").data(h);P.enter().append("g").attr("class","groups"),P.exit().remove();var D=P.selectAll("g.traces").data(i.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(_,t,e).each((function(){e._main&&n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),c=i.borderwidth,p=2*c,h=f.textGap,d=f.itemGap,m=2*(c+d),y=S(i),g=i.y<0||0===i.y&&"top"===y,v=i.y>1||1===i.y&&"bottom"===y;i._maxHeight=Math.max(g||v?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var b=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+b[0],c+b[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=h+i._width,i._width+=d+h+p,i._height+=m,l&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=M(i),T=i.x<0||0===i.x&&"right"===w,k=i.x>1||1===i.x&&"left"===w,A=v||g,C=a.width/2;i._maxWidth=Math.max(T?A&&"left"===w?o.l+o.w:C:k?A&&"right"===w?o.r+o.w:C:o.w,2*h);var L=0,E=0;r.each((function(t){var e=t[0].width+h;L=Math.max(L,e),E+=e})),_=null;var z=0;if(l){var I=0,P=0,D=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,b[0],b[1]+c+d+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),I=Math.max(I,e);var r=t+d;r+c+P>i._maxWidth&&(z=Math.max(z,P),P=0,D+=I+i.tracegroupgap,I=e),u.setTranslate(this,P,D),P+=r})),i._width=Math.max(z,P)+c,i._height=D+I+m}else{var O=r.size(),R=E+p+(O-1)*di._maxWidth&&(z=Math.max(z,U),B=0,N+=F,i._height+=F,F=0),u.setTranslate(this,b[0]+c+B,b[1]+c+N+e/2+d),U=B+r+d,B+=n,F=Math.max(F,e)})),R?(i._width=B+p,i._height=F+m):(i._width=Math.max(z,U)+p,i._height+=F+m)}}i._width=Math.ceil(Math.max(i._width+b[0],i._titleWidth+2*(c+f.titlePad))),i._height=Math.ceil(Math.max(i._height+b[1],i._titleHeight+2*(c+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var j=t._context.edits,V=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?h:_||h+t[0].width;s||(i+=d/2),u.setRect(e,0,-r/2,i,r)}))}(t,P,D,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var c,h,d,v,_=s._size,x=e.borderwidth,w=_.l+_.w*e.x-y[M(e)]*e._width,k=_.t+_.h*(1-e.y)-y[S(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var A=w,E=k;w=i.constrain(w,0,s.width-e._width),k=i.constrain(k,0,s.height-e._effHeight),w!==A&&i.log("Constrain legend.x to make legend fit inside graph"),k!==E&&i.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(m,w,k),I.on(".drag",null),m.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var z=e._effHeight;e._main||(z=e._height),C.attr({width:e._width-x,height:z-x,x:x/2,y:x/2}),u.setTranslate(L,0,0),T.select("rect").attr({width:e._width-2*x,height:z-2*x,x:x,y:x}),u.setClipUrl(L,p,t),u.setRect(I,0,0,0,0),delete e._scrollY}else{var P,D,O,R=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*f.scrollBarMargin,B=e._height-e._effHeight,N=F/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),T.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(L,p,t),q(U,R,N),m.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/F*B,0,B),R,N),0!==U&&U!==B&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,O=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));I.call(j);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,O=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));L.call(V)}if(t._context.edits.legendPosition)m.classed("cursor-move",!0),l.init({element:m.node(),gd:t,prepFn:function(){var t=u.getTranslate(m);d=t.x,v=t.y},moveFn:function(t,r){var n=d+t,i=v+r;u.setTranslate(m,n,i),c=l.align(n,0,_.l,_.l+_.w,e.xanchor),h=l.align(i,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&b(t,m,i,e,n)}})}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(L,0,-r),u.setRect(I,e._width,f.scrollBarMargin+r*i,f.scrollBarWidth,n),T.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":153,"../../lib":178,"../../lib/events":170,"../../lib/svg_text_utils":199,"../../plots/plots":263,"../../registry":272,"../color":51,"../dragelement":70,"../drawing":73,"./constants":102,"./get_legend_data":105,"./handle_click":106,"./helpers":107,"./style":109,d3:14}],105:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,p=0,h=e._main;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return d?n:Math.min(i,r)};function y(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],i=m(r.mlw,o.line,5,2);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)}))}function g(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,f=m(p(h.width,o.pts),h,5,2),d=a.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=h.color;var y=a.minExtend(o,{trace:d});c(u,y,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));i.attr("transform","translate(0,"+u+")")}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=i.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,u=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,p=n.select(this),f=l(i),d=f.colorscale,m=f.reversescale;if(d){if(!r){var y=d.length;c=0===u?d[m?y-1:0][1]:1===u?d[m?0:y-1][1]:d[Math.floor((y-1)/2)][1]}}else{var g=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(g)?g[u]||g[0]:g}p.attr("d",t[0]),c?p.call(s.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+i.uid;o.gradient(t,e,n,h(m,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,y(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=m(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)}))})).each((function(t){y(t,this,"funnel")})).each((function(t){y(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=m(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:d?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){g(t,this,"funnelarea")})).each((function(t){g(t,this,"pie")})).each((function(t){var r,i,s=t[0],c=s.trace,p=c.visible&&c.fill&&"none"!==c.fill,f=u.hasLines(c),d=c.contours,y=!1,g=!1,v=l(c),_=v.colorscale,x=v.reversescale;if(d){var b=d.coloring;"lines"===b?y=!0:f="none"===b||"heatmap"===b||d.showlines,"constraint"===d.type?p="="!==d._operation:"fill"!==b&&"heatmap"!==b||(g=!0)}var w=u.hasMarkers(c)||u.hasText(c),T=p||g,k=f||y,A=w||!T?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(p||g?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h30v6h-30z").call(p?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),_,"fill")}}),f||y){var C=m(void 0,c.line,10,5);i=a.minExtend(c,{line:{width:C}}),r=[a.minExtend(s,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||y?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",A+(y?"l30,0.0001":"h30")).call(f?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),_,"stroke")}})})).each((function(t){var r,i,s=t[0],l=s.trace,c=u.hasMarkers(l),p=u.hasText(l),h=u.hasLines(l);function f(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(d&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function m(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||p||h){var y={},g={};if(c){y.mc=f("marker.color",m),y.mx=f("marker.symbol",m),y.mo=f("marker.opacity",a.mean,[.2,1]),y.mlc=f("marker.line.color",m),y.mlw=f("marker.line.width",a.mean,[0,5],2),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var v=f("marker.size",a.mean,[2,16],12);y.ms=v,g.marker.size=v}h&&(g.line={width:f("line.width",m,[0,10],5)}),p&&(y.tx="Aa",y.tp=f("textposition",m),y.ts=10,y.tc=f("textfont.color",m),y.tf=f("textfont.family",m)),r=[a.minExtend(s,y)],(i=a.minExtend(l,g)).selectedpoints=null,i.texttemplate=null}var _=n.select(this).select("g.legendpoints"),x=_.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var b=_.selectAll("g.pointtext").data(p?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=m(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=m(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}},{"../../lib":178,"../../registry":272,"../../traces/pie/helpers":300,"../../traces/pie/style_one":301,"../../traces/scatter/subtypes":327,"../color":51,"../colorscale/helpers":62,"../drawing":73,d3:14}],110:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(i=0;i1?(C=["toggleHover"],L=["resetViews"]):d?(S=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],L=["resetGeo"]):f?(C=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(S=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],L=["resetViewMapbox"]):g?C=["hoverClosestGl2d"]:m?C=["hoverClosestPie"]:b?(C=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):C=["toggleHover"];h&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=R[r+1];else if(t=n.pmax)e=R[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;ov?(k=p,C="y0",A=v,L="y1"):(k=v,C="y1",A=p,L="y0");X(n),K(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),H.moveFn="move"===P?W:Y,H.altKey=n.altKey},doneFn:function(){if(g(t))return;f(e),J(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(g(t))return;J(s)}};function X(r){if(g(t))P=null;else if(R)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=H.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";f(e,l),P=l.split("-")[0]}}function W(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=q(_+n)):(o=function(t){return q(j(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=Z(T+i)):(l=function(t){return Z(V(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else D?B("xanchor",r.xanchor=q(_+n)):(B("x0",r.x0=q(u+n)),B("x1",r.x1=q(y+n))),O?B("yanchor",r.yanchor=Z(T+i)):(B("y0",r.y0=Z(p+i)),B("y1",r.y1=Z(v+i)));e.attr("d",b(t,r)),K(s,r)}function Y(n,i){if(F){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=q(_+n)):(o=function(t){return q(j(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=Z(T+i)):(l=function(t){return Z(V(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===P){var c=u+n,h=O?p-i:p+i;B("x0",r.x0=D?c:q(c)),B("y0",r.y0=O?h:Z(h))}else if("resize-over-end-point"===P){var f=y+n,d=O?v-i:v+i;B("x1",r.x1=D?f:q(f)),B("y1",r.y1=O?d:Z(d))}}else{var g=function(t){return-1!==P.indexOf(t)},x=g("n"),G=g("s"),H=g("w"),X=g("e"),W=x?k+i:k,Y=G?A+i:A,J=H?M+n:M,Q=X?S+n:S;O&&(x&&(W=k-i),G&&(Y=A-i)),(!O&&Y-W>10||O&&W-Y>10)&&(B(C,r[C]=O?W:Z(W)),B(L,r[L]=O?Y:Z(Y))),Q-J>10&&(B(E,r[E]=D?J:q(J)),B(z,r[z]=D?Q:q(Q)))}e.attr("d",b(t,r)),K(s,r)}function K(t,e){(D||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=j(D?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=V(O?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),D&&O){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(D){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function J(t){t.selectAll(".visual-cue").remove()}h.init(H),G.node().onmousemove=X}(t,D,l,e,r,P):!0===l.editable&&D.style("pointer-events",z||u.opacity(S)*M<=.5?"stroke":"all");D.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,y(t)}}(t,D)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,u,c,p,h=e.type,f=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),g=t._fullLayout._size;if(f?(r=m.shapePositionToRange(f),n=function(t){return f._offset+f.r2p(r(t,!0))}):n=function(t){return g.l+g.w*t},y?(o=m.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return g.t+g.h*(1-t)},"path"===h)return f&&"date"===f.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,u=t.charAt(0),c=d.paramIsX[u],p=d.paramIsY[u],h=d.numParams[u],f=t.substr(1).replace(d.paramRE,(function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(f=f.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+f}))}(e,n,s);if("pixel"===e.xsizemode){var v=n(e.xanchor);l=v+e.x0,u=v+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,p=_-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+p;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var x=(l+u)/2,b=(c+p)/2,w=Math.abs(x-l),T=Math.abs(b-c),k="A"+w+","+T,A=x+w+","+b;return"M"+A+k+" 0 1,1 "+(x+","+(b-T))+k+" 0 0,1 "+A+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:_,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&p(g),r.attr("d",m(e)),A&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),_())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function S(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function E(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,m(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,y);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||p<0){var y={left:[-f,0],right:[f,0],top:[0,-f],bottom:[0,f]}[_.side];e.attr("transform","translate("+y+")")}}}return D.call(O),I&&(S?D.on(".opacity",null):(k=0,A=!0,D.text(g).on("mouseover.opacity",(function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)}))),D.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==v?o.call("_guiRestyle",t,y,e,v):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(O)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),D.classed("js-placeholder",A),w}}},{"../../constants/alignment":153,"../../constants/interactions":155,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":263,"../../registry":272,"../color":51,"../drawing":73,d3:14,"fast-isnumeric":16}],147:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":171,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":262,"../color/attributes":50}],148:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],149:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":178,"../../plots/array_container_defaults":218,"./attributes":147,"./constants":148}],150:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(p.menuIndexAttrName,"-1"),y(t,n,i,a,e),s||g(t,n,i,a,e))}function y(t,e,r,n,i){var a=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||p.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};a.call(v,i,c,t).call(M,i,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(p.arrowSymbol[i.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+i.pad.l,y:l.headerHeight/2+p.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),g(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,f=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,C=y+g;C+M>u&&(C=u-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var E=g>T,z=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,P=d+m,D=y;P+z>l&&(P=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(E?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),E?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:D,width:z,height:I}),this._vbarYMin=D+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=E?p+z+.5:p+.5,N=h-.5,U=k?f+M+.5:f+.5,j=o._topdefs.selectAll("#"+R).data(k||E?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||E?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||E){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),E&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":178,"../color":51,"../drawing":73,d3:14}],153:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],154:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],155:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],156:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],157:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],158:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],161:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],162:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function p(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return p(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return p(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return p(t,e,r,n,i,a,1)}}},{"./mod":185}],163:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var E;k=Number(k);try{var z=y.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),E=z.newDate(k,z.toMonthIndex(k,A,I),M)}else E=z.newDate(k,Number(A),M)}catch(t){return c}return E?(E.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),A-=1;var P=new Date(Date.UTC(2e3,A,M,S,C));return P.setUTCFullYear(k),P.getUTCMonth()!==A||P.getUTCDate()!==M?c:P.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,A=5*f;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{a=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=g("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+p&&t<=i-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=b(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var i=Math.round(t/p)+m,a=y.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,p=n-e,h=o-i,f=u-a,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,i-t,a-e),l(c,p,d,o-t,u-e),l(h,f,m,t-i,e-a),l(h,f,m,r-i,n-a));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=i:h=i,p++}return a}},{"./mod":185}],177:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],178:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private");var u=t("./array");l.isTypedArray=u.isTypedArray,l.isArrayOrTypedArray=u.isArrayOrTypedArray,l.isArray1D=u.isArray1D,l.ensureArray=u.ensureArray,l.concat=u.concat,l.maxRowLength=u.maxRowLength,l.minRowLength=u.minRowLength;var c=t("./mod");l.mod=c.mod,l.modHalf=c.modHalf;var p=t("./coerce");l.valObjectMeta=p.valObjectMeta,l.coerce=p.coerce,l.coerce2=p.coerce2,l.coerceFont=p.coerceFont,l.coerceHoverinfo=p.coerceHoverinfo,l.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,l.validate=p.validate;var h=t("./dates");l.dateTime2ms=h.dateTime2ms,l.isDateTime=h.isDateTime,l.ms2DateTime=h.ms2DateTime,l.ms2DateTimeLocal=h.ms2DateTimeLocal,l.cleanDate=h.cleanDate,l.isJSDate=h.isJSDate,l.formatDate=h.formatDate,l.incrementMonth=h.incrementMonth,l.dateTick0=h.dateTick0,l.dfltRange=h.dfltRange,l.findExactDates=h.findExactDates,l.MIN_MS=h.MIN_MS,l.MAX_MS=h.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp,l.sort=f.sort,l.findIndexOfMin=f.findIndexOfMin;var d=t("./stats");l.aggNums=d.aggNums,l.len=d.len,l.mean=d.mean,l.median=d.median,l.midRange=d.midRange,l.variance=d.variance,l.stdev=d.stdev,l.interp=d.interp;var m=t("./matrix");l.init2dArray=m.init2dArray,l.transposeRagged=m.transposeRagged,l.dot=m.dot,l.translationMatrix=m.translationMatrix,l.rotationMatrix=m.rotationMatrix,l.rotationXYMatrix=m.rotationXYMatrix,l.apply2DTransform=m.apply2DTransform,l.apply2DTransform2=m.apply2DTransform2;var y=t("./angles");l.deg2rad=y.deg2rad,l.rad2deg=y.rad2deg,l.angleDelta=y.angleDelta,l.angleDist=y.angleDist,l.isFullCircle=y.isFullCircle,l.isAngleInsideSector=y.isAngleInsideSector,l.isPtInsideSector=y.isPtInsideSector,l.pathArc=y.pathArc,l.pathSector=y.pathSector,l.pathAnnulus=y.pathAnnulus;var g=t("./anchor_utils");l.isLeftAnchor=g.isLeftAnchor,l.isCenterAnchor=g.isCenterAnchor,l.isRightAnchor=g.isRightAnchor,l.isTopAnchor=g.isTopAnchor,l.isMiddleAnchor=g.isMiddleAnchor,l.isBottomAnchor=g.isBottomAnchor;var v=t("./geometry2d");l.segmentsIntersect=v.segmentsIntersect,l.segmentDistance=v.segmentDistance,l.getTextLocation=v.getTextLocation,l.clearLocationCache=v.clearLocationCache,l.getVisibleSegment=v.getVisibleSegment,l.findPointOnPath=v.findPointOnPath;var _=t("./extend");l.extendFlat=_.extendFlat,l.extendDeep=_.extendDeep,l.extendDeepAll=_.extendDeepAll,l.extendDeepNoArrays=_.extendDeepNoArrays;var x=t("./loggers");l.log=x.log,l.warn=x.warn,l.error=x.error;var b=t("./regex");l.counterRegex=b.counter;var w=t("./throttle");l.throttle=w.throttle,l.throttleDone=w.done,l.clearThrottle=w.clear;var T=t("./dom");function k(t){var e={};for(var r in t)for(var n=t[r],i=0;io?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var L=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var i;return L.test(n)?i=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,i=r[n]()),l.isValidTextValue(i)?i:""}))};var E={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return P.apply(E,arguments)};var z={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return P.apply(z,arguments)};var I=/^[:|\|]/;function P(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,p,h,f;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var D=2e9;l.seedPseudoRandom=function(){D=2e9},l.pseudoRandom=function(){var t=D;return D=(69069*D+1)%4294967296,Math.abs(D-t)<429496729?l.pseudoRandom():D/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(i-u*(r+o))+","+(a-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":156,"./anchor_utils":161,"./angles":162,"./array":163,"./clean_number":164,"./clear_responsive":166,"./coerce":167,"./dates":168,"./dom":169,"./extend":171,"./filter_unique":172,"./filter_visible":173,"./geometry2d":176,"./identity":177,"./is_plain_object":179,"./keyed_container":180,"./localize":181,"./loggers":182,"./make_trace_groups":183,"./matrix":184,"./mod":185,"./nested_property":186,"./noop":187,"./notifier":188,"./push_unique":191,"./regex":193,"./relative_attr":194,"./relink_private":195,"./search":196,"./stats":198,"./throttle":200,"./to_log_range":201,d3:14,"fast-isnumeric":16}],179:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],180:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":188}],183:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{d3:14}],184:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],186:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;la||u===i||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":156,"./matrix":184}],191:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&i.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-i;void 0===i?(l.push(c),i=c):p>s&&(a=Math.min(a,p),l.push(c),i=c)}return{vals:l,minDiff:a}},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;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":163,"fast-isnumeric":16}],199:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var M=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var E=t.attr("class")?t.attr("class").split(" ")[0]:"text";return E+="-math",L.selectAll("svg."+E).remove(),L.selectAll("g."+E+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(C[2],a,(function(n,i,a){L.selectAll("svg."+E).remove(),L.selectAll("g."+E+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return z(),void e();var l=L.append("g").classed(E+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:E,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var p=s(c,"width"),h=s(c,"height"),f=+t.attr("x")-p*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===E[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-p/2,d-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===E[0]?o.attr({x:t.attr("x"),y:d-h/2}):"a"===E[0]&&0!==E.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:f,y:+t.attr("y")+d-h/2}),A&&A.call(t,l),e(l)}))}))):z(),t}function z(){L.empty()||(E=t.attr("class")+"-math",L.select("svg."+E).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(m," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}v.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(y),E=0;E|>|>)/g;var p={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},d=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=//i;r.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,b=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(y),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function C(t,e,r){var n,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}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(m," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],201:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":16}],202:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],E=c(g,p).get(),z=[],I=-1,P=L.length;for(_=0;_L.length-(A?0:1))a.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?z.push(b):A?("add"===k&&(k={}),L.splice(b,0,k),E&&E.splice(b,0,{})):a.warn("Unrecognized full object edit value",p,b,k),-1===I&&(I=b);else for(x=0;x=0;_--)L.splice(z[_],1),E&&E.splice(z[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==i){var D;if(-1===I)D=S;else{for(P=Math.max(L.length,P),D=[],_=0;_=I);_++)D.push(b);for(_=I;_=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||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Y(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(Z(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(k.doLegend),a.layoutstyle&&s.push(k.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(k.doTicksRelayout),a.modebar&&s.push(k.doModeBar),a.camera&&s.push(k.doCamera),a.colorbars&&s.push(k.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function Z(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),f=Object.keys(e),m=d.list(t),y=o.extendDeepAll({},e),g={};for(V(e),f=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[O];)O--;var R=P.parts[O],F=P.parts[O-1]+"."+R,U=P.parts.slice(0,O).join("."),j=s(t.layout,U).get(),q=s(l,U).get(),Z=P.get();if(void 0!==D){k[I]=D,S[I]="reverse"===R?D:B(Z);var G=p.getLayoutValObject(l,P.parts);if(G&&G.impliedEdits&&null!==D)for(var Y in G.impliedEdits)C(o.relativeAttr(I,Y),G.impliedEdits[Y]);if(-1!==["width","height"].indexOf(I))if(D){C("autosize",null);var J="height"===I?"width":"height";C(J,l[J])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)C("width",D?null:l.width),C("height",D?null:l.height);else if(F.match(H))z(F),s(l,U+"._inputRange").set(null);else if(F.match(X)){z(F),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(W)&&s(l,U+"._inputDomain").set(null);if("type"===R){var $=j,tt="linear"===q.type&&"log"===D,et="log"===q.type&&"linear"===D;if(tt||et){if($&&$.range)if(q.autorange)tt&&($.range=$.range[1]>$.range[0]?[1,2]:[2,1]);else{var rt=$.range[0],nt=$.range[1];tt?(rt<=0&&nt<=0&&C(U+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),C(U+".range[0]",Math.log(rt)/Math.LN10),C(U+".range[1]",Math.log(nt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,rt)),C(U+".range[1]",Math.pow(10,nt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,D,C),c.getComponentMethod("images","convertCoords")(t,q,D,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(R.match(M)){var it=s(l,I).get(),at=(D||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,C),c.getComponentMethod("images","convertCoords")(t,it,at,C)}var ot=w.containerArrayMatch(I);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(D)?S[I]=null:w.isRemoveVal(D)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(b,lt),g[r]||(g[r]={});var ut=g[r][n];ut||(ut=g[r][n]={}),ut[st]=D,delete e[I]}else"reverse"===R?(j.range?j.range.reverse():(C(U+".autorange",!0),j.range=[1,0]),q.autorange?b.calc=!0:b.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===D||"select"===D)&&"lasso"!==Z&&"select"!==Z||l._has("gl2d")?b.plot=!0:G?A.update(b,G):b.calc=!0,P.set(D))}}for(r in g){w.applyContainerArrayChanges(t,h(a,r),g[r],b,h)||(b.plot=!0)}var ct=l._axisConstraintGroups||[];for(L in E)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(i)?y>=i.length?t.transitionOpts=i[y]:t.transitionOpts=i[0]:t.transitionOpts=i,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(m);v=A}}v.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&S<5&&(S++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,a];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(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&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function b(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var p=t._module;if(p||(p=(n.modules[t.type||a.type.dflt]||{})._module),!p)return!1;if(!(i=(r=p.attributes)&&r[o])){var h=p.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return x(i,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var i=p();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":178,"../plots/attributes":219}],213:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function _(t){var e,i,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&y(a)&&t(a,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":178,"../plots/attributes":219,"../plots/plots":263,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);_?A.width=_:null===e.width&&n(d.width)&&(A.width=d.width),x?A.height=x:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=a.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.plot(k,r,A,M).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":178,"../plots/plots":263,"../snapshot/helpers":276,"../snapshot/svgtoimg":278,"../snapshot/tosvg":280,"../version":341,"./plot_api":209,"fast-isnumeric":16}],216:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&i.push(d("unused",a,g.concat(_.length)));var A,M,S,C,L,E=_.length,z=Array.isArray(k);if(z&&(E=Math.min(E,k.length)),2===x.dimensions)for(M=0;M_[M].length&&i.push(d("unused",a,g.concat(M,_[M].length)));var I=_[M].length;for(A=0;A<(z?Math.min(I,k[M].length):I);A++)S=z?k[M][A]:k,C=v[M][A],L=_[M][A],n.validate(C,S)?L!==C&&L!==+C&&i.push(d("dynamic",a,g.concat(M,A),C,L)):i.push(d("value",a,g.concat(M,A),C))}else i.push(d("array",a,g.concat(M),v[M]));else for(M=0;M1&&f.push(d("object","layout"))),i.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&((x=A-o(y)-o(g))>M?b/x>C&&(v=y,_=g,C=b/x):b/A>C&&(v={val:y.val,pad:0},_={val:g.val,pad:0},C=b/A));if(h===f){var L=h-1,E=h+1;if(T)if(0===h)a=[0,1];else{var z=(h>0?p:c).reduce((function(t,e){return Math.max(t,o(e))}),0),I=h/(1-Math.min(.5,z/A));a=h>0?[0,I]:[I,0]}else a=k?[Math.max(0,L),Math.max(1,E)]:[L,E]}else T?(v.val>=0&&(v={val:0,pad:0}),_.val<=0&&(_={val:0,pad:0})):k&&(v.val-C*o(v)<0&&(v={val:0,pad:0}),_.val<=0&&(_={val:1,pad:0})),C=(_.val-v.val-S(y.val,g.val))/(A-o(v)-o(_)),a=[v.val-C*o(v),_.val+C*o(_)];return d&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function f(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,d,m,y,g=[],v=[],_=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(m=1/0,y=-1/0,w)for(i=0;i<_;i++)(o=e[i])0&&(m=o),o>y&&o-a&&(m=o),o>y&&o=I;i--)z(i);return{min:g,max:v,opts:r}},concatExtremes:u}},{"../../constants/numerical":156,"../../lib":178,"../../registry":272,"fast-isnumeric":16}],222:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),p=t("../../components/drawing"),h=t("./layout_attributes"),f=t("./clean_ticks"),d=t("../../constants/numerical"),m=d.ONEAVGYEAR,y=d.ONEAVGMONTH,g=d.ONEDAY,v=d.ONEHOUR,_=d.ONEMIN,x=d.ONESEC,b=d.MINUS_SIGN,w=d.BADNUM,T=t("../../constants/alignment"),k=T.MID_SHIFT,A=T.CAP_SHIFT,M=T.LINE_SPACING,S=T.OPPOSITE_SIDE,C=e.exports={};C.setConvert=t("./set_convert");var L=t("./axis_autotype"),E=t("./axis_ids");C.id2name=E.id2name,C.name2id=E.name2id,C.cleanId=E.cleanId,C.list=E.list,C.listIds=E.listIds,C.getFromId=E.getFromId,C.getFromTrace=E.getFromTrace;var z=t("./autorange");C.getAutoRange=z.getAutoRange,C.findExtremes=z.findExtremes;function I(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}C.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},C.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=C.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},C.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:C.getFromId(e,r).cleanPos)(t)},C.redrawComponents=function(t,e){e=e||C.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},C.saveRangeInitial=function(t,e){for(var r=C.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=C.tickIncrement(t,"M6","reverse")+1.5*g:a.exactMonths>.8?t=C.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var l=C.tickIncrement(t,r);if(l<=n)return l}return t}(_,t,v,u,a)),y=_,0;y<=c;)y=C.tickIncrement(y,v,!1,a);return{start:e.c2r(_,0,a),end:e.c2r(y,0,a),size:v,_dataSpan:c-u}},C.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/i,C.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),Z(t)},C.calcTicks=function(t,e){C.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=I(s.simpleMap(t.range,t.r2l)),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ca&&p=o:n<=o)&&!(u.length>r||n===e);n=C.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var i=!1;c&&n!==(0|n)&&(i=!0),u.push({minor:i,value:n})}}(),t.rangebreaks){var p=u.length;if(p){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var f,d=[],m=l?1:-1,y=l?p-1:0,g=l?0:p-1;m*g<=m*y;g+=m){var v=u[g];if(t.maskBreaks(v.value)!==w||(v.value=lt(v.value,t),!t._rl||t._rl[0]!==v.value&&t._rl[1]!==v.value)){var _=t.c2p(v.value);_===f?d[d.length-1].valueh)&&(f=_,d.push(v))}}u=d.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),b=0;b10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&a<=10||e>=15*g)t._tickround="d";else if(e>=_&&a<=16||e>=v)t._tickround="M";else if(e>=x&&a<=19||e>=_)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(X(t.exponentformat)&&!W(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}C.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>m?(e/=m,r=n(10),t.dtick="M"+12*q(e,r,R)):a>y?(e/=y,t.dtick="M"+q(e,1,F)):a>g?(t.dtick=q(e,g,t._hasDayOfWeekBreaks?[1,2,7,14]:N),t.tick0=s.dateTick0(t.calendar,!0)):a>v?t.dtick=q(e,v,F):a>_?t.dtick=q(e,_,B):a>x?t.dtick=q(e,x,B):(r=n(10),t.dtick=q(e,r,R))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+q(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=q(e,r,V)):(t.tick0=0,r=n(10),t.dtick=q(e,r,R));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},C.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?j:U,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},C.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Y(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||X(f)&&W(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":b)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":b)+h:(e.text=Y(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Y(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=Y(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=b+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=Y(e.x,t,i,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},C.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return C.hoverLabelText(t,e)+" - "+C.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=C.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];function X(t){return"SI"===t||"B"===t}function W(t){return t>14||t<-15}function Y(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=C.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};Z(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,b);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":X(l)&&(t+=H[u/3+5]));return a?b+t:t}function K(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,p)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,p),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,p):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,p),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==h._dfltTitle[d]&&(n[l]+=Q(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=p),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}W&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,et(e),n),a.autoMargin(t,rt(e),i),a.autoMargin(t,nt(e),s)})),r.skipTitle||W&&"bottom"===e.side||H.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+Q(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,f=C.getPxPosition(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?f-r:f+r):(c=e._offset+e._length/2,l="right"===e.side?f+r:f-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var m=p.getTranslate(d.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(H)}}function Y(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=tt(this),e=p.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},C.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},C.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},C.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},C.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,p,h,f,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(f="bottom"===t.side?1:-1,c=l*f,p=e+o*f,h="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+c},d.yFn=function(t){return t.dy+p+t.fontSize*h},d.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*f<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(f="right"===t.side?1:-1,c=o,p=-l*f,h=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*f},d.yFn=function(t){return t.dy+p+t.fontSize*k},d.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},C.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],J);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",p.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},C.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&C.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=v(o[l])){c=d;break}var p=i("pattern",c);if(p===d)for(l=0;l<2;l++)(u=v(o[l]))&&(e.bounds[l]=o[l]=u-1);if(p)for(l=0;l<2;l++)switch(u=o[l],p){case d:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case m:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*_)||T)for(r=0;rP&&Rz&&(z=R);f/=(z-E)/(2*I),E=u.l2r(E),z=u.l2r(z),u.range=u._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function F(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function N(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(t,e,i,a)}function U(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function j(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Z(t,e,r,n){for(var i,a,o,l,u=!1,c={},p={},h=0;h=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(j(i),2!==t||dt||jt(),ft)a.indexOf("select")>-1&&A(r,i,Y,K,e.id,Ct),a.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&dt){var s=m?U:z,u="s"===m||"w"===E?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),f="left",d="middle";if(s.fixedrange)return;m?(d="n"===m?"top":"bottom","right"===s.side&&(f="right")):"e"===E&&(f="right"),i._context.showAxisRangeEntryBoxes&&n.select(gt).call(l.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:f,verticalAlign:d}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",i,c,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+vt)),i=Math.max(0,Math.min(tt,r+_t)),a=Math.abs(n-vt),o=Math.abs(i-_t);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Mt.attr("d","M0,0Z")}if(xt.l=Math.min(vt,n),xt.r=Math.max(vt,n),xt.t=Math.min(_t,i),xt.b=Math.max(_t,i),et.isSubplotConstrained)a>L||o>L?(kt="xy",a/$>o/tt?(o=a*tt/$,_t>i?xt.t=_t-o:xt.b=_t+o):(a=o*$/tt,vt>n?xt.l=vt-a:xt.r=vt+a),Mt.attr("d",q(xt))):s();else if(rt.isSubplotConstrained)if(a>L||o>L){kt="xy";var l=Math.min(xt.l/$,(tt-xt.b)/tt),u=Math.max(xt.r/$,(tt-xt.t)/tt);xt.l=l*$,xt.r=u*$,xt.b=(1-l)*tt,xt.t=(1-u)*tt,Mt.attr("d",q(xt))}else s();else!it||om[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":178,"fast-isnumeric":16}],240:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":153}],241:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,p=u.rectMode,h=u.drawMode,f=u.openMode,d=u.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),y=t("../../components/shapes/draw_newshape/helpers").handleEllipse,g=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),_=t("../../lib/polygon"),x=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=_.filter,S=_.tester,C=t("./handle_outline").clearSelect,L=t("./helpers"),E=L.p2r,z=L.axValue,I=L.getTransform;function P(t,e,r,n,i,a,o){var s,l,u,c,p,h,d,y,g,v=e._hoverdata,_=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=U(b))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=g(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function j(t,e,r){var n,a,o,s;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!U){var r=W.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&P(e,X,i.xaxes,i.yaxes,i.subplot,i,lt),"event"===r&&X.emit("plotly_selected",void 0);s.click(X,e)})).catch(v.error)}},i.doneFn=function(){pt.remove(),x.done(ht).then((function(){x.clear(ht),i.gd.emit("plotly_selected",C),b&&i.selectionDefs&&(b.subtract=st,i.selectionDefs.push(b),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,_)),i.doneFnCompleted&&i.doneFnCompleted(ft)})).catch(v.error),U&&B(i)}},clearSelect:C,clearSelectionsCache:B,selectOnClick:P}},{"../../components/color":51,"../../components/dragelement/helpers":69,"../../components/drawing":73,"../../components/fx":91,"../../components/fx/helpers":87,"../../components/shapes/draw_newshape/display_outlines":136,"../../components/shapes/draw_newshape/helpers":137,"../../components/shapes/draw_newshape/newshapes":138,"../../lib":178,"../../lib/clear_gl_canvases":165,"../../lib/polygon":190,"../../lib/throttle":200,"../../plot_api/subroutines":213,"../../registry":272,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:25}],242:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,p=t("../../constants/numerical"),h=p.FP_SAFE,f=p.BADNUM,d=p.LOG_CLIP,m=p.ONEDAY,y=p.ONEHOUR,g=p.ONEMIN,v=p.ONESEC,_=t("./axis_ids"),x=t("./constants"),b=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function T(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);function A(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*d*Math.abs(n-i))}return f}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===f){if(!i(e))return f;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function S(e,r,n){return s(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function L(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f}function E(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=E(t);return void 0!==e?e:i(t)?+t:void 0}function I(t,e,r){return n.round(r+e*t,2)}function P(t,e,r){return(t-r)/e}var D=function(e){return i(e)?I(e,t._m,t._b):f},O=function(e){return P(e,t._m,t._b)};if(t.rangebreaks){var R="y"===p;D=function(e){if(!i(e))return f;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=R;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var p=t._B[s]||0;return isFinite(p)?I(e,t._m2,p):0},O=function(e){var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return P(e,t._m2,t._B[n])}}t.c2l="log"===t.type?A:u,t.l2c="log"===t.type?T:u,t.l2p=D,t.p2l=O,t.c2p="log"===t.type?function(t,e){return D(A(t,e))}:D,t.p2c="log"===t.type?function(t){return T(O(t))}:O,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=O,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return A(o(t),e)},t.r2d=t.r2c=function(t){return T(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=A,t.l2d=T,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return T(O(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=O,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=S,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return S(O(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,f,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=L,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(O(t))},t.r2p=t.d2p,t.p2r=O,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=E,t.l2r=t.c2r=u,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(O(t))},t.r2p=t.d2p,t.p2r=O,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=_.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),h="y"===p;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;si&&(i+=7,si&&(i+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=a.simpleMap(e.yr0,l.r2l),_=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=i.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,A=h?f[1]:0,M=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":73,"../../lib":178,"../../registry":272,"./axes":222,d3:14}],247:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var f=a(u),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;p\xa9 OpenStreetMap',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under CC BY SA.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},i=Object.keys(n);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],256:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":178}],257:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),u=t("../../lib/svg_text_utils"),c=t("./mapbox"),p=r.constants=t("./constants");function h(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;l_/2){var x=m.split("|").join("
");g.text(x).attr("data-unformatted",x).call(u.convertToTspans,t),v=l.bBox(g.node())}g.attr("transform","translate(-3, "+(8-v.height)+")"),y.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>_&&(b=_/(v.width+6));var w=[n.l+n.w*c.x[1],n.t+n.h*(1-c.y[0])];y.attr("transform","translate("+w[0]+","+w[1]+") scale("+b+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates})},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.updateLayer=function(t){var e,r=this.subplot,n=c(t),i=this.subplot.belowLookup["layout-"+this.index];if("traces"===i)for(var a=r.getMapLayers(),s=0;s1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=p(o)?function(t,r){(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(u)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),f(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=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"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){v.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})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),v.linkSubplots(p,s,c,i),v.cleanPlot(p,s,c,i);var B=!(!i._has||!i._has("gl2d")),N=!(!s._has||!s._has("gl2d")),U=!(!i._has||!i._has("cartesian"))||B,j=!(!s._has||!s._has("cartesian"))||N;U&&!j?i._bgLayer.remove():j&&!U&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&h({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=v.layoutAttributes.width.min,f=v.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,p=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(p),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,p=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:p,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];if(!n._replotting)return v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),S(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,p=n.b,h=e.width,f=e.height,d=e._pushmargin,m=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var y in d)m[y]||delete d[y];for(var g in d.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:p}},d){var _=d[g].l||{},x=d[g].b||{},b=_.val,w=_.size,T=x.val,k=x.size;for(var A in d){if(i(w)&&d[A].r){var M=d[A].r.val,C=d[A].r.size;if(M>b){var L=(w*M+(C-h)*b)/(M-b),E=(C*(1-b)+(w-h)*(1-M))/(M-b);L>=0&&E>=0&&h-(L+E)>0&&L+E>s+u&&(s=L,u=E)}}if(i(k)&&d[A].t){var z=d[A].t.val,I=d[A].t.size;if(z>T){var P=(k*z+(I-f)*T)/(z-T),D=(I*(1-T)+(k-f)*(1-z))/(z-T);P>=0&&D>=0&&f-(D+P)>0&&P+D>p+c&&(p=P,c=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(p),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(f)-r.t-r.b,!e._replotting&&v.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var O=3*(1+Object.keys(m).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return a.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return a.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}v.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},v.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(p.layout=c(s)),t.framework&&t.framework.isPolar&&(p=t.framework.getConfig()),u&&(p.frames=c(u)),a&&(p.config=c(t._context,!0)),"object"===n?p:JSON.stringify(p)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(z(u,h,f),i=0;i=0?h.angularAxis.domain:n.extent(T),C=Math.abs(T[1]-T[0]);A&&!k&&(C=0);var L=S.slice();M&&k&&(L[1]+=C);var E=h.angularAxis.ticksCount||4;E>8&&(E=E/(E/8)+E%8),h.angularAxis.ticksStep&&(E=(L[1]-L[0])/E);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(E*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var I=n.range.apply(this,L);if(I=I.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?C:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"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){O=t.select(".legend-group").attr({transform:"translate("+[_,h.margin.top]+")"}).style({display:"block"});var N=f.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:f.map((function(t,e){return t.name||"Element"+e})),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:h.legend.reverseOrder})})();var U=O.node().getBBox();_=Math.min(h.width-U.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,_=Math.max(10,_),b=[h.margin.left+_,h.margin.top+_],r.range([0,_]),c.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[b[0]+_,b[1]-_]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+b+")").style({cursor:"crosshair"});var j=[(h.width-(h.margin.left+h.margin.right+2*_+(U?U.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*_))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),t.select(".outer-group").attr("transform","translate("+j+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(B).text(h.title.text),q=V.node().getBBox();V.attr({x:b[0]-q.width/2,y:b[1]-_-20})}var Z=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=Z.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}Z.select("circle.outside-circle").attr({r:_}).style(F);var H=t.select("circle.background-circle").attr({r:_}).style({fill:h.backgroundColor,stroke:h.stroke});function X(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);Z.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Z.selectAll(".domain").style(F),Z.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(B).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,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Z.selectAll("g>line").style({stroke:"black"})}var Y=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),K=Y.enter().append("g").classed("angular-tick",!0);Y.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Y.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(F),K.selectAll(".minor").style({stroke:h.minorTickColor}),Y.select("line.grid-line").attr({x1:h.tickLength?_-h.tickLength:0,x2:_}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var J=Y.select("text.axis-text").attr({x:_+h.labelOffset,dy:a+"em",transform:function(t,e){var r=X(t),n=_+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(B);h.angularAxis.rewriteTicks&&J.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var Q=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));O.attr({transform:"translate("+[_+Q,h.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(f);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),f[0]||$){var et=[];f.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.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 i(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var pt=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(H).angle;pt.attr({x2:-_,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(_+12,r+180);lt.text(o.util.round(it)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(H).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(H).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,p=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),f=[p.left+p.width/2-j[0]-h.left,p.top+p.height/2-j[1]-h.top];ct.config({color:s}).text(c),ct.move(f)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)})),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,p,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).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},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var p=e.angularScale.range(),h=Math.abs(p[1]-p[0])/o[0].length*Math.PI/180,f=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:f,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);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(d).each(u[e.geometryType]),y.exit().remove(),m.exit().remove()}))}return a.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)})),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a}))})),o=n.merge(a);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,p=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),f=h.enter().append("svg").attr({width:300,height:p+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});f.append("g").classed("legend-axis",!0),f.append("g").classed("legend-marks",!0);var d=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(d).range(l),y=n.scale[c?"linear":"ordinal"]().domain(d)[c?"range":"rangePoints"]([0,p]);if(c){var g=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);g.enter().append("stop"),g.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var v=h.select(".legend-marks").selectAll("path.legend-mark").data(o);v.enter().append("path").classed("legend-mark",!0),v.attr({transform:function(t,e){return"translate("+[u/2,y(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return m(e)}}),v.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(_);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",p=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(p);var h=a.padding,f=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},m=f.width+2*h+l,y=f.height+2*h;return r.attr({d:"M"+[[l,-y/2],[l,-y/4],[a.hasTick?0:l,0],[l,y/4],[l,y/2],[m,y/2],[m,-y/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-y/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=i({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 a=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=i({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":153,"../../../lib":178,d3:14}],268:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,p=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,p.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){p.undo()},h.redo=function(){p.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":51,"../../../lib":178,"./micropolar":267,"./undo_manager":269,d3:14}],269:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],i=0;i-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":51,"../components/drawing":73,"../constants/xmlns_namespaces":157,"../lib":178,d3:14}],281:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":50,"../../components/colorscale/attributes":58,"../../lib/extend":171,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattergeo/attributes":330}],282:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o,h.mockAxis),[t]}},{"../../lib":178,"../../plots/cartesian/axes":222,"./attributes":281}],285:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":255,"./convert":287}],291:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":58,"../../lib/extend":171,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattermapbox/attributes":332}],292:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=i(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c")}(u,c,l[0].t.labels),[s]}}},{"../../lib":178,"../../plots/cartesian/axes":222,"../scattermapbox/hover":337}],297:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":255,"./convert":293}],299:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],300:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;rs&&A[y].gap;)y--;for(v=A[y].s,d=A.length-1;d>y;d--)A[d].s=v;for(;sM[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],310:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),p=t("./line_defaults"),h=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var g=l(t,e,m,y);if(g||(e.visible=!1),e.visible){var v=u(t,e,m,y),_=!v&&gG!=(F=I[E][1])>=G&&(D=I[E-1][0],O=I[E][0],F-R&&(P=D+(O-D)*(G-R)/(F-R),j=Math.min(j,P),V=Math.max(V,P)));j=Math.max(j,0),V=Math.min(V,h._length);var H=s.defaultLine;return s.opacity(p.fillcolor)?H=p.fillcolor:s.opacity((p.line||{}).color)&&(H=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:H,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":51,"../../components/fx":91,"../../lib":178,"../../registry":272,"./get_trace_color":313}],315:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":302,"./attributes":303,"./calc":304,"./cross_trace_calc":308,"./cross_trace_defaults":309,"./defaults":310,"./format_labels":312,"./hover":314,"./marker_colorbar":321,"./plot":323,"./select":324,"./style":326,"./subtypes":327}],316:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"../../lib":178}],317:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,a,h,f,d,m,y,g,v,_,x,b,w,T,k,A,M,S=e.xaxis,C=e.yaxis,L="log"===S.type,E="log"===C.type,z=S._length,I=C._length,P=e.connectGaps,D=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,U=t.length,j=new Array(U),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?C.l2p(n.y):C.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;E&&l===i&&(a*=Math.abs(S._m*I*(S._m>0?o:s)/(C._m*z*(C._m>0?o:s)))),a*=1e3}if(l===i){if(E&&(l=C.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===j[V-1][0],i=r===j[V-1][1];if(!n||!i)if(V>1){var a=e===j[V-2][0],o=r===j[V-2][1];n&&(e===et||e===rt)&&a?o?V--:j[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:j[V-1]=t:j[V++]=t}else j[V++]=t}function ct(t){j[V-1][0]!==t[0]&&j[V-1][1]!==t[1]&&ut([Y,K]),ut(t),J=null,Y=K=0}function pt(t){if(A=t[0]/z,M=t[1]/I,X=t[0]rt?rt:0,W=t[1]it?it:0,X||W){if(V)if(J){var e=$(J,t);e.length>1&&(ct(e[0]),j[V++]=e[1])}else Q=$(j[V-1],t)[0],j[V++]=Q;else j[V++]=[X||t[0],W||t[1]];var r=j[V-1];X&&W&&(r[0]!==X||r[1]!==W)?(J&&(Y!==X&&K!==W?ut(Y&&K?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Y||X,K||W]):Y&&K&&ut([Y,K])),ut([X,W])):Y-X&&K-W&&ut([X||Y,W||K]),J=t,Y=X,K=W}else J&&ct($(J,t)[0]),j[V++]=t;var n,i,a,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&H(o,t)G(d,ht))break;a=d,(b=g[0]*y[0]+g[1]*y[1])>_?(_=b,h=d,m=!1):b=t.length||!d)break;pt(d),n=d}}else pt(h)}J&&ut([Y||J[0],K||J[1]]),B.push(j.slice(0,V))}return B}},{"../../constants/numerical":156,"../../lib":178,"./constants":307}],318:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],319:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(a=0;a=0?l=f:(l=f=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":16}],321:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],322:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":51,"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"./subtypes":327}],323:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),p=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var E=b.fill.charAt(b.fill.length-1);"x"!==E&&"y"!==E&&(E=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var z,I,P="",D=[],O=b._prevtrace;O&&(P=O._prevRevpath||"",L=O._nextFill,D=O._polygons);var R,F,B,N,U,j,V,q="",Z="",G=[],H=a.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(G.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",z).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",z),l.singleLineStyle(p,i)}}}}}var X=A.selectAll(".js-line").data(G);v(X.exit()).style("opacity",0).remove(),X.each(H(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(H(!0)),l.setClipUrl(X,r.layerClipId,t),G.length?(C?(C.datum(p),N&&j&&(E?("y"===E?N[1]=j[1]=x.c2p(0,!0):"x"===E&&(N[0]=j[0]=_.c2p(0,!0)),v(C).attr("d","M"+j+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(C).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===b.fill.substr(0,6)&&q&&P?("tonext"===b.fill?v(L).attr("d",q+"Z"+P+"Z").call(l.singleFillStyle):v(L).attr("d",q+"L"+P.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(D)):(Y(L),b._polygons=null)),b._prevRevpath=Z,b._prevPolygons=V):(C?Y(C):L&&Y(L),b._polygons=b._prevRevpath=b._prevPolygons=null),M.datum(p),S.datum(p),function(e,i,a){var o,c=a[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?J:K:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,_,x)?(l.singlePointStyle(e,a,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,_,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(M,W,t),l.setClipUrl(S,W,t)}function Y(t){v(t).attr("d","M0,0Z")}function K(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,m=!!a&&a.duration>0,y=p(t,e,r);((c=i.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,a)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,a)}));d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":73,"../../lib":178,"../../lib/polygon":190,"../../registry":272,"./line_points":317,"./link_traces":319,"./subtypes":327,d3:14}],324:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-c.c2p([d,a]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=l[t.index],y=m.lonlat,g=[i.modHalf(y[0],360)+f,y[1]],v=c.c2p(g),_=p.c2p(g),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(u,m),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(i||-1!==n.indexOf("text"))&&o(e,t,u);return u.join("
")}(u,m,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":91,"../../constants/numerical":156,"../../lib":178,"../scatter/get_trace_color":313}],338:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":257,"../scatter/marker_colorbar":321,"../scattergeo/calc":331,"./attributes":332,"./defaults":334,"./event_data":335,"./format_labels":336,"./hover":337,"./plot":339,"./select":340}],339:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],u=0;u=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],28:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}a.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var f,d,m;return a=L(a),{ok:p,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(O(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*E(this._r,255))+"%",g:a(100*E(this._g,255))+"%",b:a(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%)":"rgba("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function E(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,U=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!U.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],35:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],36:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":212,"../../plots/cartesian/constants":228,"../../plots/font_attributes":250,"./arrow_paths":35}],37:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],p=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":178,"../../plots/cartesian/axes":222,"./draw":42}],38:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Z=!1,G=["x","y"],H=0;H1)&&(tt===$?((ut=et.r2fraction(e["a"+Q]))<0||ut>1)&&(Z=!0):Z=!0),X=et._offset+et.r2p(e[Q]),K=.5}else"x"===Q?(Y=e[Q],X=x.l+x.w*Y):(Y=1-e[Q],X=x.t+x.h*Y),K=e.showarrow?.5:Y;if(e.showarrow){lt.head=X;var ct=e["a"+Q];J=nt*j(.5,e.xanchor)-it*j(.5,e.yanchor),tt===$?(lt.tail=et._offset+et.r2p(ct),W=J):(lt.tail=X+ct,W=J+ct),lt.text=lt.tail+J;var pt=_["x"===Q?"width":"height"];if("paper"===$&&(lt.head=o.constrain(lt.head,1,pt-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),ft=Math.min(lt.tail+3,lt.text)-pt;ht>0?(lt.tail+=ht,lt.text+=ht):ft>0&&(lt.tail-=ft,lt.text-=ft)}lt.tail+=st,lt.head+=st}else W=J=at*j(K,ot),lt.text=X+J;lt.text+=st,J+=st,W+=st,e["_"+Q+"padplus"]=at/2+W,e["_"+Q+"padminus"]=at/2-W,e["_"+Q+"size"]=at,e["_"+Q+"shift"]=J}if(Z)P.remove();else{var dt=0,mt=0;if("left"!==e.align&&(dt=(w-g)*("center"===e.align?.5:1)),"top"!==e.valign&&(mt=(I-v)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:R+dt-1,y:R+mt}).call(u.setClipUrl,B?M:null,t);else{var yt=R+mt-d.top,gt=R+dt-d.left;V.call(p.positionText,gt,yt).call(u.setClipUrl,B?M:null,t)}N.select("rect").call(u.setRect,R,R,w,I),F.call(u.setRect,D/2,D/2,O-D,U-D),P.call(u.setTranslate,Math.round(S.x.text-O/2),Math.round(S.y.text-U/2)),E.attr({transform:"rotate("+C+","+S.x.text+","+S.y.text+")"});var vt,_t=function(r,n){L.selectAll(".annotation-arrow-g").remove();var c=S.x.head,p=S.y.head,h=S.x.tail+r,d=S.y.tail+n,g=S.x.text+r,v=S.y.text+n,_=o.rotationXYMatrix(C,g,v),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),z=+F.attr("width"),I=+F.attr("height"),D=g-.5*z,O=D+z,R=v-.5*I,B=R+I,N=[[D,R,D,B],[D,B,O,B],[O,B,O,R],[O,R,D,R]].map(M);if(!N.reduce((function(t,e){return t^!!o.segmentsIntersect(c,p,c+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){N.forEach((function(t){var e=o.segmentsIntersect(h,d,c,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var U=e.arrowwidth,j=e.arrowcolor,V=e.arrowside,q=L.append("g").style({opacity:l.opacity(j)}).classed("annotation-arrow-g",!0),Z=q.append("path").attr("d","M"+h+","+d+"L"+c+","+p).style("stroke-width",U+"px").call(l.stroke,l.rgb(j));if(m(Z,V,e),b.annotationPosition&&Z.node().parentNode&&!a){var G=c,H=p;if(e.standoff){var X=Math.sqrt(Math.pow(c-h,2)+Math.pow(p-d,2));G+=e.standoff*(h-c)/X,H+=e.standoff*(d-p)/X}var W,Y,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(d-H),transform:"translate("+G+","+H+")"}).style("stroke-width",U+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);W=t.x,Y=t.y,s&&s.autorange&&T(s._name+".autorange",!0),y&&y.autorange&&T(y._name+".autorange",!0)},moveFn:function(t,r){var n=w(W,Y),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),k("y",y?y.p2r(y.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",y.p2r(y.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),E.attr({transform:"rotate("+C+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&_t(0,0),z)f.init({element:P.node(),gd:t,prepFn:function(){vt=E.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",y.p2r(y.r2p(e.ay)+r)):k("ay",e.ay+r),_t(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=f.align(u+t/x.w,l,0,1,e.xanchor)}if(y)o=y.p2r(y.r2p(e.y)+r);else{var c=e._ysize/x.h,p=e.y-(e._yshift+e.yshift)/x.h-c/2;o=f.align(p-r/x.h,c,0,1,e.yanchor)}k("x",i),k("y",o),s&&y||(n=f.getCursor(s?.5:i,y?.5:o,e.xanchor,e.yanchor))}E.attr({transform:"translate("+t+","+r+")"+vt}),h(P,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){h(P),i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,g=p.backoff*f+r.standoff,v=h.backoff*d+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var _=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,_))+Math.PI,g&&v&&g+v>Math.sqrt(_*_+x*x))return void z();if(g){if(g*g>_*_+x*x)return void z();var b=g*Math.cos(l),w=g*Math.sin(l);s.x+=b,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(v){if(v*v>_*_+x*x)return void z();var T=v*Math.cos(l),k=v*Math.sin(l);o.x-=T,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var A=c.getTotalLength(),M="";if(A1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":253,"../annotations/draw":42}],49:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Y=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));H*=Y*u.roundUp(W/Y,[2,5,10]),(Math.abs(L.start)/L.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=H}G.domain=[V+N,V+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var K,J=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),Q=t.select("."+k.cbaxis),$=0;function tt(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===A?(1-(V+R-N))*l.h+l.t+3+.75*n:(1-(V+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var a=t.select("."+k.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],p=a.select(".h"+G._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*b),p?($=h.bBox(p).height)>f&&(c[1]-=($-f)/2):o.node()&&!o.classed(k.jsPlaceholder)&&($=h.bBox(o.node()).height),$){if($+=5,"top"===A)G.domain[1]-=$/l.h,c[1]*=-1;else{G.domain[0]+=$/l.h;var d=m.lineCount(o);c[1]+=(1-d)*f}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-l.t)+")");var g=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(z);g.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),g.exit().remove();var v=M.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));g.each((function(t,a){var o=[0===a?M[0]:(z[a]+z[a-1])/2,a===z.length-1?M[1]:(z[a]+z[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,v[0],v[1]);var s=n.select(this).attr({x:U,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=C(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var _=t.select("."+k.cblines).selectAll("path."+k.cbline).data(y.color&&y.width?I:[]);_.enter().append("path").classed(k.cbline,!0),_.exit().remove(),_.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(G.c2p(t))+y.width/2%1)+"h"+P).call(h.lineGroupStyle,y.width,S(t),y.dash)})),Q.selectAll("g."+G._id+"tick,path").remove();var x=U+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),T=s.makeTransFn(G),L=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:Q,path:s.makeTickPath(G,x,L),transFn:T}),s.drawLabels(r,G,{vals:w,layer:Q,transFn:T,labelFns:s.makeLabelFns(G,x)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=P+e.outlinewidth/2+h.bBox(Q.node()).width;if((K=J.select("text")).node()&&!K.classed(k.jsPlaceholder)){var i,o=J.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(A)?h.bBox(o).width:h.bBox(J.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=q-Z;t.select("."+k.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:Z-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(f.fill,e.bgcolor).call(f.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:U,y:Z+e.ypad+("top"===A?$:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-$,2)}).call(f.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var p={},d=w[e.yanchor],m=T[e.yanchor];"pixels"===e.lenmode?(p.y=e.y,p.t=u*d,p.b=u*m):(p.t=p.b=0,p.yt=e.y+e.len*d,p.yb=e.y-e.len*m);var y=w[e.xanchor],g=T[e.xanchor];if("pixels"===e.thicknessmode)p.x=e.x,p.l=s*y,p.r=s*g;else{var v=s-P;p.l=v*y,p.r=v*g,p.xl=e.x-e.thickness*y,p.xr=e.x+e.thickness*g}a.autoMargin(r,e._id,p)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),p(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);p(t,u)},doneFn:function(){if(p(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":153,"../../lib":178,"../../lib/extend":171,"../../lib/setcursor":197,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../plots/cartesian/axis_defaults":224,"../../plots/cartesian/layout_attributes":236,"../../plots/cartesian/position_defaults":239,"../../plots/plots":263,"../../registry":272,"../color":51,"../colorscale/helpers":62,"../dragelement":70,"../drawing":73,"../titles":146,"./constants":53,d3:14,tinycolor2:34}],56:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":178}],57:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":52,"./defaults":54,"./draw":55,"./has_colorbar":56}],58:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var f=s+"auto",d=s+"min",m=s+"max",y=s+"mid",g=(o(h+f),o(h+d),o(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":193,"../colorbar/attributes":52,"./scales.js":66}],59:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,p=a(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return i.aggNums(Math.min,null,l)},g=function(){return i.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":178,"./helpers":62,"fast-isnumeric":16}],60:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],68:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":178}],69:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],70:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":178,"../../plots/cartesian/constants":228,"./align":67,"./cursor":68,"./unhover":71,"has-hover":18,"has-passive-events":19,"mouse-event-offset":23}],71:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":169,"../../lib/events":170,"../../lib/throttle":200,"../fx/constants":85}],72:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],73:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,f=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,g=e.exports={};g.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},g.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},g.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},g.setRect=function(t,e,r,n,i){t.call(g.setPosition,e,r).call(g.setSize,n,i)},g.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},g.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);g.translatePoint(t,i,e,r)}))},g.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},g.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){g.hideOutsideRangePoint(t,n.select(this),r,i,s,l)}))}))}},g.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},g.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),g.dashLine(e,l,o)},g.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(g.dashLine,l,o)}))},g.dashLine=function(t,e,r){r=+r||0,e=g.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},g.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},g.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},g.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var v=t("./symbol_defs");g.symbolNames=[],g.symbolFuncs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(v).forEach((function(t){var e=v[t],r=e.n;g.symbolList.push(r,t,r+100,t+"-open"),g.symbolNames[r]=t,g.symbolFuncs[r]=e.f,e.needLine&&(g.symbolNeedLines[r]=!0),e.noDot?g.symbolNoDot[r]=!0:g.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(g.symbolNoFill[r]=!0)}));var _=g.symbolNames.length;function x(t,e){var r=t%100;return g.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}g.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=g.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var b={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:b},horizontalreversed:{node:"linearGradient",attrs:b,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};g.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=k[i],h=new Array(c),f=0;f"+g(t);d._gradientUrlQueryParts[v]=1},g.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},g.pointStyle=function(t,e,r){if(t.size()){var i=g.makePointStyleFns(e);t.each((function(t){g.singlePointStyle(t,n.select(this),e,i,r)}))}},g.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=g.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var p,h,f,d=!1;if(t.so)f=o.outlierwidth,h=o.outliercolor,p=a.outliercolor;else{var m=(o||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(p=s.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var y=a.gradient,v=t.mgt;if(v?d=!0:v=y&&y.type,Array.isArray(v)&&(v=v[0],k[v]||(v=0)),v&&"none"!==v){var _=t.mgc;_?d=!0:_=y.color;var b=r.uid;d&&(b+="-"+t.i),g.gradient(e,i,b,v,[[0,_],[1,p]],"fill")}else s.fill(e,p);f&&s.stroke(e,h)}},g.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=g.tryColorscale(r,""),e.lineScale=g.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,g.makeSelectedPointStyleFns(t)),e},g.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,p=s.opacity,h=void 0!==c,d=void 0!==p;(u.isArrayOrTypedArray(l)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?p:f*e});var m=i.color,y=a.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?y||e:g||e});var v=i.size,_=a.size,x=s.size,b=void 0!==_,w=void 0!==x;return o.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},g.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,f))},e},g.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(g.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}g.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=g.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var p=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};y(h,e,t.i);var f=e._meta||{};l=u.texttemplateString(l,p,s._d3locale,h,t,f)}var d=t.tp||e.textposition,m=S(t,e),v=i?i(t):t.tc||e.textfont.color;a.call(g.font,t.tf||e.textfont.family,m,v).text(l).call(c.convertToTspans,r).call(M,d,m,t.mrc)}else a.remove()}))}},g.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(i,a),M(i,o,l,t.mrc2||t.mrc)}))}};function C(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),p=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}g.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(g.savedBBoxes={},z=0),r&&(g.savedBBoxes[r]=y),z++,u.extendFlat({},y)},g.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},g.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},g.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},g.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},g.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var D=/\s*sc.*/;g.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(D,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var O=/translate\([^)]*\)\s*$/;g.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(O);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":87,"../../constants/alignment":153,"../../constants/interactions":155,"../../constants/xmlns_namespaces":157,"../../lib":178,"../../lib/svg_text_utils":199,"../../registry":272,"../../traces/scatter/make_bubble_size_func":320,"../../traces/scatter/subtypes":327,"../color":51,"../colorscale":63,"./symbol_defs":74,d3:14,"fast-isnumeric":16,tinycolor2:34}],74:[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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:14}],75:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],76:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var p=d.width;a="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(a+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(f.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(f.copy_ystyle?d:f).width;a="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(a+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":327,"../drawing":73,d3:14,"fast-isnumeric":16}],81:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":51,d3:14}],82:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":171,"../../plots/font_attributes":250,"./layout_attributes":92}],83:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=$+x[0]._offset,e.pointerY=tt+w[0]._offset,D="xval"in e?m.flat(l,e.xval):m.p2c(x,$),O="yval"in e?m.flat(l,e.yval):m.p2c(w,tt),!i(D[0])||!i(O[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(F=0;FH&&(Y.splice(0,H),rt=Y[0].distance),g&&0!==W&&0===Y.length){G.distance=W,G.index=!1;var h=N._module.hoverPoints(G,q,Z,"closest",c._hoverlayer);if(h&&(h=h.filter((function(t){return t.spikeDistance<=W}))),h&&h.length){var f,d=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var y=d[0];i(y.x0)&&i(y.y0)&&(f=at(y),(!J.vLinePoint||J.vLinePoint.spikeDistance>f.spikeDistance)&&(J.vLinePoint=f))}var v=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var _=v[0];i(_.x0)&&i(_.y0)&&(f=at(_),(!J.hLinePoint||J.hLinePoint.spikeDistance>f.spikeDistance)&&(J.hLinePoint=f))}}}}}function it(t,e){for(var r,n=null,i=1/0,a=0;a1||Y.length>1)||"closest"===L&&Q&&Y.length>1,At=p.combine(c.plot_bgcolor||p.background,c.paper_bgcolor),Mt={hovermode:L,rotateLabels:kt,bgColor:At,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},St=C(Y,Mt,t);m.isUnifiedHover(L)||(!function(t,e,r){var n,i,a,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?b:1)/2,pmin:0,pmax:i?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(a=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=a;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var w=x[s],T=w.datum;T.offset=w.dp,T.del=w.del}}}(St,kt?"xa":"ya",c),E(St,kt));if(e.target&&e.target.tagName){var Ct=d.getComponentMethod("annotations","hasClickToShow")(t,xt);u(n.select(e.target),Ct?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,_t))return;_t&&t.emit("plotly_unhover",{event:e,points:_t});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:w,xvals:D,yvals:O})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map((function(t){return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:a,outerContainer:o},l=C(i,s,e.gd),u=0,c=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function C(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,f=e.outerContainer,d=e.commonLabelOpts||{},x=e.fontFamily||y.HOVERFONT,b=e.fontSize||y.HOVERFONTSIZE,w=t[0],T=w.xa,S=w.ya,C="y"===a.charAt(0)?"yLabel":"xLabel",E=w[C],z=(String(E)||"").split(" ")[0],I=f.node().getBoundingClientRect(),P=I.top,D=I.width,O=I.height,R=void 0!==E&&w.distance<=e.hoverdistance&&("x"===a||"y"===a);if(R){var F,B,N=!0;for(F=0;Fi.width-C?(g=i.width-C,s.attr("d","M"+(C-k)+",0L"+C+","+M+k+"v"+M+(2*A+_.height)+"H-"+C+"V"+M+k+"H"+(C-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(A+_.width/2)+"v"+M+(2*A+_.height)+"H-"+(A+_.width/2)+"V"+M+k+"H-"+k+"Z")}else{var L,z,I;"right"===S.side?(L="start",z=1,I="",g=T._offset+T._length):(L="end",z=-1,I="-",g=T._offset),v=S._offset+(w.y0+w.y1)/2,u.attr("text-anchor",L),s.attr("d","M0,0L"+I+k+","+k+"V"+(A+_.height/2)+"h"+I+(2*A+_.width)+"V-"+(A+_.height/2)+"H"+I+k+"V-"+k+"Z");var D,O=_.height/2,R=P-_.top-O,F="clip"+i._uid+"commonlabel"+S._id;if(g<_.width+2*A+k){D="M-"+(k+A)+"-"+O+"h-"+(_.width-A)+"V"+O+"h"+(_.width-A)+"Z";var B=_.width-g+A;l.positionText(u,B,R),"end"===L&&u.selectAll("tspan").each((function(){var t=n.select(this),e=c.tester.append("text").text(t.text()).call(c.font,y),r=e.node().getBoundingClientRect();Math.round(r.width)=0?$-=rt:$+=2*A;var nt=et.height+2*A,it=Q+nt>=O;return nt<=O&&(Q<=P?Q=S._offset+2*A:it&&(Q=O-nt)),tt.attr("transform","translate("+$+","+Q+")"),tt}var at=h.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return at.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(p.fill,p.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,x,b)})),at.exit().remove(),at.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,h=p.combine(p.opacity(o)?o:p.defaultLine,u),f=p.combine(p.opacity(t.color)?t.color:p.defaultLine,u),d=t.borderColor||p.contrast(h),m=L(t,R,a,i,E,e),y=m[0],g=m[1],v=e.select("text.nums").call(c.font,t.fontFamily||x,t.fontSize||b,t.fontColor||d).text(y).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),T=0,M=0;if(g&&g!==y){w.call(c.font,t.fontFamily||x,t.fontSize||b,f).text(g).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var S=w.node().getBoundingClientRect();T=S.width+2*A,M=S.height+2*A}else w.remove(),e.select("rect").remove();e.select("path").style({fill:h,stroke:d});var C,z,I=v.node().getBoundingClientRect(),F=t.xa._offset+(t.x0+t.x1)/2,B=t.ya._offset+(t.y0+t.y1)/2,N=Math.abs(t.x1-t.x0),U=Math.abs(t.y1-t.y0),j=I.width+k+A+T;if(t.ty0=P-I.top,t.bx=I.width+2*A,t.by=Math.max(I.height+2*A,M),t.anchor="start",t.txwidth=I.width,t.tx2width=T,t.offset=0,s)t.pos=F,C=B+U/2+j<=O,z=B-U/2-j>=0,"top"!==t.idealAlign&&C||!z?C?(B+=U/2,t.anchor="start"):t.anchor="middle":(B-=U/2,t.anchor="end");else if(t.pos=B,C=F+N/2+j<=D,z=F-N/2-j>=0,"left"!==t.idealAlign&&C||!z)if(C)F+=N/2,t.anchor="start";else{t.anchor="middle";var V=j/2,q=F+V-D,Z=F-V;q>0&&(F-=q),Z<0&&(F+=-Z)}else F-=N/2,t.anchor="end";v.attr("text-anchor",t.anchor),T&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+F+","+B+")"+(s?"rotate("+_+")":""))})),at}function L(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=D(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===i?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,p=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,p,u,h,t.trace._meta)).replace(S,(function(e,r){return s=D(r,t.nameLength),""}))),[l,s]}function E(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(k+A),p=u+s*(t.txwidth+A),h=0,f=t.offset;"middle"===a&&(u-=t.tx2width/2,p+=t.txwidth/2+A),e&&(f*=-T,h=t.offset*w),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(f-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+h)+","+(k+f)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+h)+"V"+(f-k)+"Z");var d=u+h,m=f+t.ty0-t.by/2+A,y=t.textAlign||"auto";"auto"!==y&&("left"===y&&"start"!==a?(i.attr("text-anchor","start"),d="middle"===a?-t.bx/2-t.tx2width/2+A:-t.bx-A):"right"===y&&"end"!==a&&(i.attr("text-anchor","end"),d="middle"===a?t.bx/2-t.tx2width/2-A:t.bx+A)),i.call(l.positionText,d,m),t.tx2width&&(r.select("text.name").call(l.positionText,p+s*A+h,f+t.ty0-t.by/2+A),r.select("rect").call(c.setRect,p+(s-1)*t.tx2width/2+h,f-t.by/2-1,t.tx2width,t.by+2))}))}function z(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:f.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:f.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=f.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+f.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=f.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+f.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function I(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||h){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=i._offset+v.y);var _,x,b=a.readability(v.color,m)<1.5?p.contrast(m):v.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||b,A=f.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=A,x=y),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),_=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":c.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(d){var C,L,E=e.vLinePoint;n=E&&E.xa,i=E&&E.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+E.x,L=i._offset+E.y);var z,I,P=a.readability(E.color,m)<1.5?p.contrast(m):E.color,D=n.spikemode,O=n.spikethickness,R=n.spikecolor||P,F=f.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(z=F,I=L),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),z=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:I,"stroke-width":O,stroke:R,"stroke-dasharray":c.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:I,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function P(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function D(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":178,"../../lib/events":170,"../../lib/override_cursor":189,"../../lib/svg_text_utils":199,"../../plots/cartesian/axes":222,"../../registry":272,"../color":51,"../dragelement":70,"../drawing":73,"../legend/defaults":103,"../legend/draw":104,"./constants":85,"./helpers":87,d3:14,"fast-isnumeric":16,tinycolor2:34}],89:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":178,"../color":51,"./helpers":87}],90:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}var o,s=a("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1!==m||u.uirevision){var y=a.newContainer(e,"legend");if(b("uirevision",e.uirevision),!1!==m){b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),i.coerceFont(b,"font",e.font);var g,v,_,x=b("orientation");"h"===x?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(g=1.02,v=1,_="auto"),b("traceorder",h),l.isGrouped(e.legend)&&b("tracegroupgap"),b("itemsizing"),b("itemclick"),b("itemdoubleclick"),b("x",g),b("xanchor"),b("y",v),b("yanchor",_),b("valign"),i.noneOrAll(u,y,["x","y"]),b("title.text")&&(b("title.side","h"===x?"left":"top"),i.coerceFont(b,"title.font",e.font))}}function b(t,e){return i.coerce(u,y,o,t,e)}}},{"../../lib":178,"../../plot_api/plot_template":212,"../../plots/layout_attributes":254,"../../registry":272,"./attributes":101,"./helpers":107}],104:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a=t.data()[0][0],s=a.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,d=r._maxNameLength;r.entries?n=a.text:(n=l?a.label:s.name,s._meta&&(n=i.templateString(n,s._meta)));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,r.font).text(h?T(n,d):n),p.positionText(m,f.textGap,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var s=a.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),p=u[u.length-1],h=i.keyedContainer(s,"transforms["+p+"].styles","target","value.name");h.set(a.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):A(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}}))}function A(t,e,r,n){n._main||t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),a=i.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*m;if(a){var h=u.bBox(a);o=h.height,s=h.width,n?u.setTranslate(i,0,.25*o):u.setTranslate(i,l,.75*o+l)}else{var d=t.select(n?".legendtext":".legendtitletext"),y=p.lineCount(d),g=d.node();o=c*y,s=g?u.bBox(g).width:0;var v=c*((y-1)/2-.3);n?p.positionText(d,f.textGap,-v):p.positionText(d,f.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,p="legend"+s._uid;if(e?(r=e.layer,p+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&v(t.calcdata,e)}else{if(!e.entries)return;h=v(e.entries,e)}var d=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+p).remove(),a.autoMargin(t,"legend");var m=i.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=i.ensureSingleById(s._topdefs,"clipPath",p,(function(t){t.append("rect")})),C=i.ensureSingle(m,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var L=i.ensureSingle(m,"g","scrollbox"),E=e.title;if(e._titleWidth=0,e._titleHeight=0,E.text){var z=i.ensureSingle(L,"text","legendtitletext");z.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,E.font).text(E.text),A(z,L,t,e)}else L.selectAll(".legendtitletext").remove();var I=i.ensureSingle(m,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),P=L.selectAll("g.groups").data(h);P.enter().append("g").attr("class","groups"),P.exit().remove();var D=P.selectAll("g.traces").data(i.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(_,t,e).each((function(){e._main&&n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),c=i.borderwidth,p=2*c,h=f.textGap,d=f.itemGap,m=2*(c+d),y=S(i),g=i.y<0||0===i.y&&"top"===y,v=i.y>1||1===i.y&&"bottom"===y;i._maxHeight=Math.max(g||v?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var b=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+b[0],c+b[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=h+i._width,i._width+=d+h+p,i._height+=m,l&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=M(i),T=i.x<0||0===i.x&&"right"===w,k=i.x>1||1===i.x&&"left"===w,A=v||g,C=a.width/2;i._maxWidth=Math.max(T?A&&"left"===w?o.l+o.w:C:k?A&&"right"===w?o.r+o.w:C:o.w,2*h);var L=0,E=0;r.each((function(t){var e=t[0].width+h;L=Math.max(L,e),E+=e})),_=null;var z=0;if(l){var I=0,P=0,D=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,b[0],b[1]+c+d+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),I=Math.max(I,e);var r=t+d;r+c+P>i._maxWidth&&(z=Math.max(z,P),P=0,D+=I+i.tracegroupgap,I=e),u.setTranslate(this,P,D),P+=r})),i._width=Math.max(z,P)+c,i._height=D+I+m}else{var O=r.size(),R=E+p+(O-1)*di._maxWidth&&(z=Math.max(z,U),B=0,N+=F,i._height+=F,F=0),u.setTranslate(this,b[0]+c+B,b[1]+c+N+e/2+d),U=B+r+d,B+=n,F=Math.max(F,e)})),R?(i._width=B+p,i._height=F+m):(i._width=Math.max(z,U)+p,i._height+=F+m)}}i._width=Math.ceil(Math.max(i._width+b[0],i._titleWidth+2*(c+f.titlePad))),i._height=Math.ceil(Math.max(i._height+b[1],i._titleHeight+2*(c+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var j=t._context.edits,V=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?h:_||h+t[0].width;s||(i+=d/2),u.setRect(e,0,-r/2,i,r)}))}(t,P,D,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var c,h,d,v,_=s._size,x=e.borderwidth,w=_.l+_.w*e.x-y[M(e)]*e._width,k=_.t+_.h*(1-e.y)-y[S(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var A=w,E=k;w=i.constrain(w,0,s.width-e._width),k=i.constrain(k,0,s.height-e._effHeight),w!==A&&i.log("Constrain legend.x to make legend fit inside graph"),k!==E&&i.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(m,w,k),I.on(".drag",null),m.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var z=e._effHeight;e._main||(z=e._height),C.attr({width:e._width-x,height:z-x,x:x/2,y:x/2}),u.setTranslate(L,0,0),T.select("rect").attr({width:e._width-2*x,height:z-2*x,x:x,y:x}),u.setClipUrl(L,p,t),u.setRect(I,0,0,0,0),delete e._scrollY}else{var P,D,O,R=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*f.scrollBarMargin,B=e._height-e._effHeight,N=F/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),T.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(L,p,t),q(U,R,N),m.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/F*B,0,B),R,N),0!==U&&U!==B&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,O=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));I.call(j);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,O=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));L.call(V)}if(t._context.edits.legendPosition)m.classed("cursor-move",!0),l.init({element:m.node(),gd:t,prepFn:function(){var t=u.getTranslate(m);d=t.x,v=t.y},moveFn:function(t,r){var n=d+t,i=v+r;u.setTranslate(m,n,i),c=l.align(n,0,_.l,_.l+_.w,e.xanchor),h=l.align(i,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&b(t,m,i,e,n)}})}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(L,0,-r),u.setRect(I,e._width,f.scrollBarMargin+r*i,f.scrollBarWidth,n),T.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":153,"../../lib":178,"../../lib/events":170,"../../lib/svg_text_utils":199,"../../plots/plots":263,"../../registry":272,"../color":51,"../dragelement":70,"../drawing":73,"./constants":102,"./get_legend_data":105,"./handle_click":106,"./helpers":107,"./style":109,d3:14}],105:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,p=0,h=e._main;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return d?n:Math.min(i,r)};function y(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],i=m(r.mlw,o.line,5,2);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)}))}function g(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,f=m(p(h.width,o.pts),h,5,2),d=a.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=h.color;var y=a.minExtend(o,{trace:d});c(u,y,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));i.attr("transform","translate(0,"+u+")")}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=i.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,u=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,u){var c,p=n.select(this),f=l(i),d=f.colorscale,m=f.reversescale;if(d){if(!r){var y=d.length;c=0===u?d[m?y-1:0][1]:1===u?d[m?0:y-1][1]:d[Math.floor((y-1)/2)][1]}}else{var g=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(g)?g[u]||g[0]:g}p.attr("d",t[0]),c?p.call(s.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+i.uid;o.gradient(t,e,n,h(m,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,y(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=m(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)}))})).each((function(t){y(t,this,"funnel")})).each((function(t){y(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=m(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:d?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}}))})).each((function(t){g(t,this,"funnelarea")})).each((function(t){g(t,this,"pie")})).each((function(t){var r,i,s=t[0],c=s.trace,p=c.visible&&c.fill&&"none"!==c.fill,f=u.hasLines(c),d=c.contours,y=!1,g=!1,v=l(c),_=v.colorscale,x=v.reversescale;if(d){var b=d.coloring;"lines"===b?y=!0:f="none"===b||"heatmap"===b||d.showlines,"constraint"===d.type?p="="!==d._operation:"fill"!==b&&"heatmap"!==b||(g=!0)}var w=u.hasMarkers(c)||u.hasText(c),T=p||g,k=f||y,A=w||!T?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(p||g?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h30v6h-30z").call(p?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,h(x),_,"fill")}}),f||y){var C=m(void 0,c.line,10,5);i=a.minExtend(c,{line:{width:C}}),r=[a.minExtend(s,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||y?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",A+(y?"l30,0.0001":"h30")).call(f?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,h(x),_,"stroke")}})})).each((function(t){var r,i,s=t[0],l=s.trace,c=u.hasMarkers(l),p=u.hasText(l),h=u.hasLines(l);function f(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(d&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function m(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(c||p||h){var y={},g={};if(c){y.mc=f("marker.color",m),y.mx=f("marker.symbol",m),y.mo=f("marker.opacity",a.mean,[.2,1]),y.mlc=f("marker.line.color",m),y.mlw=f("marker.line.width",a.mean,[0,5],2),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var v=f("marker.size",a.mean,[2,16],12);y.ms=v,g.marker.size=v}h&&(g.line={width:f("line.width",m,[0,10],5)}),p&&(y.tx="Aa",y.tp=f("textposition",m),y.ts=10,y.tc=f("textfont.color",m),y.tf=f("textfont.family",m)),r=[a.minExtend(s,y)],(i=a.minExtend(l,g)).selectedpoints=null,i.texttemplate=null}var _=n.select(this).select("g.legendpoints"),x=_.selectAll("path.scatterpts").data(c?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var b=_.selectAll("g.pointtext").data(p?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=m(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=m(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}},{"../../lib":178,"../../registry":272,"../../traces/pie/helpers":300,"../../traces/pie/style_one":301,"../../traces/scatter/subtypes":327,"../color":51,"../colorscale/helpers":62,"../drawing":73,d3:14}],110:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(i=0;i1?(C=["toggleHover"],L=["resetViews"]):d?(S=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],L=["resetGeo"]):f?(C=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(S=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],L=["resetViewMapbox"]):g?C=["hoverClosestGl2d"]:m?C=["hoverClosestPie"]:b?(C=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):C=["toggleHover"];h&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=R[r+1];else if(t=n.pmax)e=R[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;ov?(k=p,C="y0",A=v,L="y1"):(k=v,C="y1",A=p,L="y0");X(n),K(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),H.moveFn="move"===P?W:Y,H.altKey=n.altKey},doneFn:function(){if(g(t))return;f(e),J(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(g(t))return;J(s)}};function X(r){if(g(t))P=null;else if(R)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=H.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";f(e,l),P=l.split("-")[0]}}function W(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=q(_+n)):(o=function(t){return q(j(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=Z(T+i)):(l=function(t){return Z(V(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else D?B("xanchor",r.xanchor=q(_+n)):(B("x0",r.x0=q(u+n)),B("x1",r.x1=q(y+n))),O?B("yanchor",r.yanchor=Z(T+i)):(B("y0",r.y0=Z(p+i)),B("y1",r.y1=Z(v+i)));e.attr("d",b(t,r)),K(s,r)}function Y(n,i){if(F){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=q(_+n)):(o=function(t){return q(j(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=Z(T+i)):(l=function(t){return Z(V(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===P){var c=u+n,h=O?p-i:p+i;B("x0",r.x0=D?c:q(c)),B("y0",r.y0=O?h:Z(h))}else if("resize-over-end-point"===P){var f=y+n,d=O?v-i:v+i;B("x1",r.x1=D?f:q(f)),B("y1",r.y1=O?d:Z(d))}}else{var g=function(t){return-1!==P.indexOf(t)},x=g("n"),G=g("s"),H=g("w"),X=g("e"),W=x?k+i:k,Y=G?A+i:A,J=H?M+n:M,Q=X?S+n:S;O&&(x&&(W=k-i),G&&(Y=A-i)),(!O&&Y-W>10||O&&W-Y>10)&&(B(C,r[C]=O?W:Z(W)),B(L,r[L]=O?Y:Z(Y))),Q-J>10&&(B(E,r[E]=D?J:q(J)),B(z,r[z]=D?Q:q(Q)))}e.attr("d",b(t,r)),K(s,r)}function K(t,e){(D||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=j(D?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=V(O?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),D&&O){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(D){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function J(t){t.selectAll(".visual-cue").remove()}h.init(H),G.node().onmousemove=X}(t,D,l,e,r,P):!0===l.editable&&D.style("pointer-events",z||u.opacity(S)*M<=.5?"stroke":"all");D.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,y(t)}}(t,D)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,u,c,p,h=e.type,f=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),g=t._fullLayout._size;if(f?(r=m.shapePositionToRange(f),n=function(t){return f._offset+f.r2p(r(t,!0))}):n=function(t){return g.l+g.w*t},y?(o=m.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return g.t+g.h*(1-t)},"path"===h)return f&&"date"===f.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,u=t.charAt(0),c=d.paramIsX[u],p=d.paramIsY[u],h=d.numParams[u],f=t.substr(1).replace(d.paramRE,(function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(f=f.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+f}))}(e,n,s);if("pixel"===e.xsizemode){var v=n(e.xanchor);l=v+e.x0,u=v+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,p=_-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+p;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var x=(l+u)/2,b=(c+p)/2,w=Math.abs(x-l),T=Math.abs(b-c),k="A"+w+","+T,A=x+w+","+b;return"M"+A+k+" 0 1,1 "+(x+","+(b-T))+k+" 0 0,1 "+A+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:_,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&p(g),r.attr("d",m(e)),A&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),_())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function S(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function E(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,m(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+c.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,y);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||p<0){var y={left:[-f,0],right:[f,0],top:[0,-f],bottom:[0,f]}[_.side];e.attr("transform","translate("+y+")")}}}return D.call(O),I&&(S?D.on(".opacity",null):(k=0,A=!0,D.text(g).on("mouseover.opacity",(function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)}))),D.call(c.makeEditable,{gd:t}).on("edit",(function(e){void 0!==v?o.call("_guiRestyle",t,y,e,v):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(O)})).on("input",(function(t){this.text(t||" ").call(c.positionText,x.x,x.y)}))),D.classed("js-placeholder",A),w}}},{"../../constants/alignment":153,"../../constants/interactions":155,"../../lib":178,"../../lib/svg_text_utils":199,"../../plots/plots":263,"../../registry":272,"../color":51,"../drawing":73,d3:14,"fast-isnumeric":16}],147:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":171,"../../plot_api/edit_types":205,"../../plot_api/plot_template":212,"../../plots/font_attributes":250,"../../plots/pad_attributes":262,"../color/attributes":50}],148:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],149:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":178,"../../plots/array_container_defaults":218,"./attributes":147,"./constants":148}],150:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(p.menuIndexAttrName,"-1"),y(t,n,i,a,e),s||g(t,n,i,a,e))}function y(t,e,r,n,i){var a=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||p.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};a.call(v,i,c,t).call(M,i,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(p.arrowSymbol[i.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+i.pad.l,y:l.headerHeight/2+p.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),g(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,f=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,C=y+g;C+M>u&&(C=u-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var E=g>T,z=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,P=d+m,D=y;P+z>l&&(P=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(E?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),E?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:D,width:z,height:I}),this._vbarYMin=D+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=E?p+z+.5:p+.5,N=h-.5,U=k?f+M+.5:f+.5,j=o._topdefs.selectAll("#"+R).data(k||E?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||E?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||E){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),E&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":178,"../color":51,"../drawing":73,d3:14}],153:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],154:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],155:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],156:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],157:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],158:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],161:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],162:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function p(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return p(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return p(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return p(t,e,r,n,i,a,1)}}},{"./mod":185}],163:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var E;k=Number(k);try{var z=y.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),E=z.newDate(k,z.toMonthIndex(k,A,I),M)}else E=z.newDate(k,Number(A),M)}catch(t){return c}return E?(E.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),A-=1;var P=new Date(Date.UTC(2e3,A,M,S,C));return P.setUTCFullYear(k),P.getUTCMonth()!==A||P.getUTCDate()!==M?c:P.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,A=5*f;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{a=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=g("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+p&&t<=i-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=b(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var i=Math.round(t/p)+m,a=y.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,p=n-e,h=o-i,f=u-a,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,i-t,a-e),l(c,p,d,o-t,u-e),l(h,f,m,t-i,e-a),l(h,f,m,r-i,n-a));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=i:h=i,p++}return a}},{"./mod":185}],177:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],178:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private");var u=t("./array");l.isTypedArray=u.isTypedArray,l.isArrayOrTypedArray=u.isArrayOrTypedArray,l.isArray1D=u.isArray1D,l.ensureArray=u.ensureArray,l.concat=u.concat,l.maxRowLength=u.maxRowLength,l.minRowLength=u.minRowLength;var c=t("./mod");l.mod=c.mod,l.modHalf=c.modHalf;var p=t("./coerce");l.valObjectMeta=p.valObjectMeta,l.coerce=p.coerce,l.coerce2=p.coerce2,l.coerceFont=p.coerceFont,l.coerceHoverinfo=p.coerceHoverinfo,l.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,l.validate=p.validate;var h=t("./dates");l.dateTime2ms=h.dateTime2ms,l.isDateTime=h.isDateTime,l.ms2DateTime=h.ms2DateTime,l.ms2DateTimeLocal=h.ms2DateTimeLocal,l.cleanDate=h.cleanDate,l.isJSDate=h.isJSDate,l.formatDate=h.formatDate,l.incrementMonth=h.incrementMonth,l.dateTick0=h.dateTick0,l.dfltRange=h.dfltRange,l.findExactDates=h.findExactDates,l.MIN_MS=h.MIN_MS,l.MAX_MS=h.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp,l.sort=f.sort,l.findIndexOfMin=f.findIndexOfMin;var d=t("./stats");l.aggNums=d.aggNums,l.len=d.len,l.mean=d.mean,l.median=d.median,l.midRange=d.midRange,l.variance=d.variance,l.stdev=d.stdev,l.interp=d.interp;var m=t("./matrix");l.init2dArray=m.init2dArray,l.transposeRagged=m.transposeRagged,l.dot=m.dot,l.translationMatrix=m.translationMatrix,l.rotationMatrix=m.rotationMatrix,l.rotationXYMatrix=m.rotationXYMatrix,l.apply2DTransform=m.apply2DTransform,l.apply2DTransform2=m.apply2DTransform2;var y=t("./angles");l.deg2rad=y.deg2rad,l.rad2deg=y.rad2deg,l.angleDelta=y.angleDelta,l.angleDist=y.angleDist,l.isFullCircle=y.isFullCircle,l.isAngleInsideSector=y.isAngleInsideSector,l.isPtInsideSector=y.isPtInsideSector,l.pathArc=y.pathArc,l.pathSector=y.pathSector,l.pathAnnulus=y.pathAnnulus;var g=t("./anchor_utils");l.isLeftAnchor=g.isLeftAnchor,l.isCenterAnchor=g.isCenterAnchor,l.isRightAnchor=g.isRightAnchor,l.isTopAnchor=g.isTopAnchor,l.isMiddleAnchor=g.isMiddleAnchor,l.isBottomAnchor=g.isBottomAnchor;var v=t("./geometry2d");l.segmentsIntersect=v.segmentsIntersect,l.segmentDistance=v.segmentDistance,l.getTextLocation=v.getTextLocation,l.clearLocationCache=v.clearLocationCache,l.getVisibleSegment=v.getVisibleSegment,l.findPointOnPath=v.findPointOnPath;var _=t("./extend");l.extendFlat=_.extendFlat,l.extendDeep=_.extendDeep,l.extendDeepAll=_.extendDeepAll,l.extendDeepNoArrays=_.extendDeepNoArrays;var x=t("./loggers");l.log=x.log,l.warn=x.warn,l.error=x.error;var b=t("./regex");l.counterRegex=b.counter;var w=t("./throttle");l.throttle=w.throttle,l.throttleDone=w.done,l.clearThrottle=w.clear;var T=t("./dom");function k(t){var e={};for(var r in t)for(var n=t[r],i=0;io?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var L=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var i;return L.test(n)?i=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,i=r[n]()),l.isValidTextValue(i)?i:""}))};var E={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return P.apply(E,arguments)};var z={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return P.apply(z,arguments)};var I=/^[:|\|]/;function P(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,u){var c,p,h,f;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var D=2e9;l.seedPseudoRandom=function(){D=2e9},l.pseudoRandom=function(){var t=D;return D=(69069*D+1)%4294967296,Math.abs(D-t)<429496729?l.pseudoRandom():D/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,"translate("+(i-u*(r+o))+","+(a-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":156,"./anchor_utils":161,"./angles":162,"./array":163,"./clean_number":164,"./clear_responsive":166,"./coerce":167,"./dates":168,"./dom":169,"./extend":171,"./filter_unique":172,"./filter_visible":173,"./geometry2d":176,"./identity":177,"./is_plain_object":179,"./keyed_container":180,"./localize":181,"./loggers":182,"./make_trace_groups":183,"./matrix":184,"./mod":185,"./nested_property":186,"./noop":187,"./notifier":188,"./push_unique":191,"./regex":193,"./relative_attr":194,"./relink_private":195,"./search":196,"./stats":198,"./throttle":200,"./to_log_range":201,d3:14,"fast-isnumeric":16}],179:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],180:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":210,"./notifier":188}],183:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{d3:14}],184:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],186:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;la||u===i||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":156,"./matrix":184}],191:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&i.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-i;void 0===i?(l.push(c),i=c):p>s&&(a=Math.min(a,p),l.push(c),i=c)}return{vals:l,minDiff:a}},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;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":163,"fast-isnumeric":16}],199:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var M=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var E=t.attr("class")?t.attr("class").split(" ")[0]:"text";return E+="-math",L.selectAll("svg."+E).remove(),L.selectAll("g."+E+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(C[2],a,(function(n,i,a){L.selectAll("svg."+E).remove(),L.selectAll("g."+E+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return z(),void e();var l=L.append("g").classed(E+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:E,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var p=s(c,"width"),h=s(c,"height"),f=+t.attr("x")-p*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===E[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-p/2,d-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===E[0]?o.attr({x:t.attr("x"),y:d-h/2}):"a"===E[0]&&0!==E.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:f,y:+t.attr("y")+d-h/2}),A&&A.call(t,l),e(l)}))}))):z(),t}function z(){L.empty()||(E=t.attr("class")+"-math",L.select("svg."+E).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(m," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}v.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(y),E=0;E|>|>)/g;var p={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},d=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=//i;r.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,x=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,b=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(y),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function C(t,e,r){var n,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}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(m," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],201:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":16}],202:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],203:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],204:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],E=c(g,p).get(),z=[],I=-1,P=L.length;for(_=0;_L.length-(A?0:1))a.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?z.push(b):A?("add"===k&&(k={}),L.splice(b,0,k),E&&E.splice(b,0,{})):a.warn("Unrecognized full object edit value",p,b,k),-1===I&&(I=b);else for(x=0;x=0;_--)L.splice(z[_],1),E&&E.splice(z[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==i){var D;if(-1===I)D=S;else{for(P=Math.max(L.length,P),D=[],_=0;_=I);_++)D.push(b);for(_=I;_=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||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Y(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(Z(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(k.doLegend),a.layoutstyle&&s.push(k.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(k.doTicksRelayout),a.modebar&&s.push(k.doModeBar),a.camera&&s.push(k.doCamera),a.colorbars&&s.push(k.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function Z(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),f=Object.keys(e),m=d.list(t),y=o.extendDeepAll({},e),g={};for(V(e),f=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[O];)O--;var R=P.parts[O],F=P.parts[O-1]+"."+R,U=P.parts.slice(0,O).join("."),j=s(t.layout,U).get(),q=s(l,U).get(),Z=P.get();if(void 0!==D){k[I]=D,S[I]="reverse"===R?D:B(Z);var G=p.getLayoutValObject(l,P.parts);if(G&&G.impliedEdits&&null!==D)for(var Y in G.impliedEdits)C(o.relativeAttr(I,Y),G.impliedEdits[Y]);if(-1!==["width","height"].indexOf(I))if(D){C("autosize",null);var J="height"===I?"width":"height";C(J,l[J])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)C("width",D?null:l.width),C("height",D?null:l.height);else if(F.match(H))z(F),s(l,U+"._inputRange").set(null);else if(F.match(X)){z(F),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(W)&&s(l,U+"._inputDomain").set(null);if("type"===R){var $=j,tt="linear"===q.type&&"log"===D,et="log"===q.type&&"linear"===D;if(tt||et){if($&&$.range)if(q.autorange)tt&&($.range=$.range[1]>$.range[0]?[1,2]:[2,1]);else{var rt=$.range[0],nt=$.range[1];tt?(rt<=0&&nt<=0&&C(U+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),C(U+".range[0]",Math.log(rt)/Math.LN10),C(U+".range[1]",Math.log(nt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,rt)),C(U+".range[1]",Math.pow(10,nt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,D,C),c.getComponentMethod("images","convertCoords")(t,q,D,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(R.match(M)){var it=s(l,I).get(),at=(D||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,C),c.getComponentMethod("images","convertCoords")(t,it,at,C)}var ot=w.containerArrayMatch(I);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(D)?S[I]=null:w.isRemoveVal(D)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(b,lt),g[r]||(g[r]={});var ut=g[r][n];ut||(ut=g[r][n]={}),ut[st]=D,delete e[I]}else"reverse"===R?(j.range?j.range.reverse():(C(U+".autorange",!0),j.range=[1,0]),q.autorange?b.calc=!0:b.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===D||"select"===D)&&"lasso"!==Z&&"select"!==Z||l._has("gl2d")?b.plot=!0:G?A.update(b,G):b.calc=!0,P.set(D))}}for(r in g){w.applyContainerArrayChanges(t,h(a,r),g[r],b,h)||(b.plot=!0)}var ct=l._axisConstraintGroups||[];for(L in E)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(i)?y>=i.length?t.transitionOpts=i[y]:t.transitionOpts=i[0]:t.transitionOpts=i,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(m);v=A}}v.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&S<5&&(S++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,a];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(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&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function b(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var p=t._module;if(p||(p=(n.modules[t.type||a.type.dflt]||{})._module),!p)return!1;if(!(i=(r=p.attributes)&&r[o])){var h=p.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return x(i,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var i=p();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":178,"../plots/attributes":219}],213:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function _(t){var e,i,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&y(a)&&t(a,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":178,"../plots/attributes":219,"../plots/plots":263,"./plot_config":210,"./plot_schema":211,"./plot_template":212}],215:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);_?A.width=_:null===e.width&&n(d.width)&&(A.width=d.width),x?A.height=x:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=a.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.plot(k,r,A,M).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":178,"../plots/plots":263,"../snapshot/helpers":276,"../snapshot/svgtoimg":278,"../snapshot/tosvg":280,"../version":341,"./plot_api":209,"fast-isnumeric":16}],216:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&i.push(d("unused",a,g.concat(_.length)));var A,M,S,C,L,E=_.length,z=Array.isArray(k);if(z&&(E=Math.min(E,k.length)),2===x.dimensions)for(M=0;M_[M].length&&i.push(d("unused",a,g.concat(M,_[M].length)));var I=_[M].length;for(A=0;A<(z?Math.min(I,k[M].length):I);A++)S=z?k[M][A]:k,C=v[M][A],L=_[M][A],n.validate(C,S)?L!==C&&L!==+C&&i.push(d("dynamic",a,g.concat(M,A),C,L)):i.push(d("value",a,g.concat(M,A),C))}else i.push(d("array",a,g.concat(M),v[M]));else for(M=0;M1&&f.push(d("object","layout"))),i.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&((x=A-o(y)-o(g))>M?b/x>C&&(v=y,_=g,C=b/x):b/A>C&&(v={val:y.val,pad:0},_={val:g.val,pad:0},C=b/A));if(h===f){var L=h-1,E=h+1;if(T)if(0===h)a=[0,1];else{var z=(h>0?p:c).reduce((function(t,e){return Math.max(t,o(e))}),0),I=h/(1-Math.min(.5,z/A));a=h>0?[0,I]:[I,0]}else a=k?[Math.max(0,L),Math.max(1,E)]:[L,E]}else T?(v.val>=0&&(v={val:0,pad:0}),_.val<=0&&(_={val:0,pad:0})):k&&(v.val-C*o(v)<0&&(v={val:0,pad:0}),_.val<=0&&(_={val:1,pad:0})),C=(_.val-v.val-S(y.val,g.val))/(A-o(v)-o(_)),a=[v.val-C*o(v),_.val+C*o(_)];return d&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function f(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,d,m,y,g=[],v=[],_=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(m=1/0,y=-1/0,w)for(i=0;i<_;i++)(o=e[i])0&&(m=o),o>y&&o-a&&(m=o),o>y&&o=I;i--)z(i);return{min:g,max:v,opts:r}},concatExtremes:u}},{"../../constants/numerical":156,"../../lib":178,"../../registry":272,"fast-isnumeric":16}],222:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),p=t("../../components/drawing"),h=t("./layout_attributes"),f=t("./clean_ticks"),d=t("../../constants/numerical"),m=d.ONEAVGYEAR,y=d.ONEAVGMONTH,g=d.ONEDAY,v=d.ONEHOUR,_=d.ONEMIN,x=d.ONESEC,b=d.MINUS_SIGN,w=d.BADNUM,T=t("../../constants/alignment"),k=T.MID_SHIFT,A=T.CAP_SHIFT,M=T.LINE_SPACING,S=T.OPPOSITE_SIDE,C=e.exports={};C.setConvert=t("./set_convert");var L=t("./axis_autotype"),E=t("./axis_ids");C.id2name=E.id2name,C.name2id=E.name2id,C.cleanId=E.cleanId,C.list=E.list,C.listIds=E.listIds,C.getFromId=E.getFromId,C.getFromTrace=E.getFromTrace;var z=t("./autorange");C.getAutoRange=z.getAutoRange,C.findExtremes=z.findExtremes;function I(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}C.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},C.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=C.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},C.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:C.getFromId(e,r).cleanPos)(t)},C.redrawComponents=function(t,e){e=e||C.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},C.saveRangeInitial=function(t,e){for(var r=C.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=C.tickIncrement(t,"M6","reverse")+1.5*g:a.exactMonths>.8?t=C.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var l=C.tickIncrement(t,r);if(l<=n)return l}return t}(_,t,v,u,a)),y=_,0;y<=c;)y=C.tickIncrement(y,v,!1,a);return{start:e.c2r(_,0,a),end:e.c2r(y,0,a),size:v,_dataSpan:c-u}},C.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/i,C.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),Z(t)},C.calcTicks=function(t,e){C.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=I(s.simpleMap(t.range,t.r2l)),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;ca&&p=o:n<=o)&&!(u.length>r||n===e);n=C.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var i=!1;c&&n!==(0|n)&&(i=!0),u.push({minor:i,value:n})}}(),t.rangebreaks){var p=u.length;if(p){var h=0;"auto"===t.tickmode&&(h=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var f,d=[],m=l?1:-1,y=l?p-1:0,g=l?0:p-1;m*g<=m*y;g+=m){var v=u[g];if(t.maskBreaks(v.value)!==w||(v.value=lt(v.value,t),!t._rl||t._rl[0]!==v.value&&t._rl[1]!==v.value)){var _=t.c2p(v.value);_===f?d[d.length-1].valueh)&&(f=_,d.push(v))}}u=d.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&u.pop(),t._tmax=(u[u.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var x=new Array(u.length),b=0;b10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&a<=10||e>=15*g)t._tickround="d";else if(e>=_&&a<=16||e>=v)t._tickround="M";else if(e>=x&&a<=19||e>=_)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(X(t.exponentformat)&&!W(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}C.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>m?(e/=m,r=n(10),t.dtick="M"+12*q(e,r,R)):a>y?(e/=y,t.dtick="M"+q(e,1,F)):a>g?(t.dtick=q(e,g,t._hasDayOfWeekBreaks?[1,2,7,14]:N),t.tick0=s.dateTick0(t.calendar,!0)):a>v?t.dtick=q(e,v,F):a>_?t.dtick=q(e,_,B):a>x?t.dtick=q(e,x,B):(r=n(10),t.dtick=q(e,r,R))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+q(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=q(e,r,V)):(t.tick0=0,r=n(10),t.dtick=q(e,r,R));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},C.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?j:U,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},C.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=Y(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||X(f)&&W(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":b)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":b)+h:(e.text=Y(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Y(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=Y(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=b+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=Y(e.x,t,i,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},C.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return C.hoverLabelText(t,e)+" - "+C.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=C.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];function X(t){return"SI"===t||"B"===t}function W(t){return t>14||t<-15}function Y(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=C.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};Z(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,b);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":X(l)&&(t+=H[u/3+5]));return a?b+t:t}function K(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-c:0,p)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,p),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,p):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,p),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==h._dfltTitle[d]&&(n[l]+=Q(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=p),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}W&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,et(e),n),a.autoMargin(t,rt(e),i),a.autoMargin(t,nt(e),s)})),r.skipTitle||W&&"bottom"===e.side||H.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+Q(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,f=C.getPxPosition(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?f-r:f+r):(c=e._offset+e._length/2,l="right"===e.side?f+r:f-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var m=p.getTranslate(d.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(H)}}function Y(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=tt(this),e=p.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},C.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},C.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},C.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},C.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,p,h,f,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(f="bottom"===t.side?1:-1,c=l*f,p=e+o*f,h="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+c},d.yFn=function(t){return t.dy+p+t.fontSize*h},d.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*f<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(f="right"===t.side?1:-1,c=o,p=-l*f,h=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*f},d.yFn=function(t){return t.dy+p+t.fontSize*k},d.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},C.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],J);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",p.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},C.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&C.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=v(o[l])){c=d;break}var p=i("pattern",c);if(p===d)for(l=0;l<2;l++)(u=v(o[l]))&&(e.bounds[l]=o[l]=u-1);if(p)for(l=0;l<2;l++)switch(u=o[l],p){case d:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case m:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*_)||T)for(r=0;rP&&Rz&&(z=R);f/=(z-E)/(2*I),E=u.l2r(E),z=u.l2r(z),u.range=u._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function F(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function N(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(t,e,i,a)}function U(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function j(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Z(t,e,r,n){for(var i,a,o,l,u=!1,c={},p={},h=0;h=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(j(i),2!==t||dt||jt(),ft)a.indexOf("select")>-1&&A(r,i,Y,K,e.id,Ct),a.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&dt){var s=m?U:z,u="s"===m||"w"===E?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),f="left",d="middle";if(s.fixedrange)return;m?(d="n"===m?"top":"bottom","right"===s.side&&(f="right")):"e"===E&&(f="right"),i._context.showAxisRangeEntryBoxes&&n.select(gt).call(l.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:f,verticalAlign:d}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",i,c,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+vt)),i=Math.max(0,Math.min(tt,r+_t)),a=Math.abs(n-vt),o=Math.abs(i-_t);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Mt.attr("d","M0,0Z")}if(xt.l=Math.min(vt,n),xt.r=Math.max(vt,n),xt.t=Math.min(_t,i),xt.b=Math.max(_t,i),et.isSubplotConstrained)a>L||o>L?(kt="xy",a/$>o/tt?(o=a*tt/$,_t>i?xt.t=_t-o:xt.b=_t+o):(a=o*$/tt,vt>n?xt.l=vt-a:xt.r=vt+a),Mt.attr("d",q(xt))):s();else if(rt.isSubplotConstrained)if(a>L||o>L){kt="xy";var l=Math.min(xt.l/$,(tt-xt.b)/tt),u=Math.max(xt.r/$,(tt-xt.t)/tt);xt.l=l*$,xt.r=u*$,xt.b=(1-l)*tt,xt.t=(1-u)*tt,Mt.attr("d",q(xt))}else s();else!it||om[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":178,"fast-isnumeric":16}],240:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":153}],241:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,p=u.rectMode,h=u.drawMode,f=u.openMode,d=u.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),y=t("../../components/shapes/draw_newshape/helpers").handleEllipse,g=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),_=t("../../lib/polygon"),x=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=_.filter,S=_.tester,C=t("./handle_outline").clearSelect,L=t("./helpers"),E=L.p2r,z=L.axValue,I=L.getTransform;function P(t,e,r,n,i,a,o){var s,l,u,c,p,h,d,y,g,v=e._hoverdata,_=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=U(b))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=g(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function j(t,e,r){var n,a,o,s;for(n=0;n=0)X._fullLayout._deactivateShape(X);else if(!U){var r=W.clickmode;x.done(ht).then((function(){if(x.clear(ht),2===t){for(lt.remove(),w=0;w-1&&P(e,X,i.xaxes,i.yaxes,i.subplot,i,lt),"event"===r&&X.emit("plotly_selected",void 0);s.click(X,e)})).catch(v.error)}},i.doneFn=function(){pt.remove(),x.done(ht).then((function(){x.clear(ht),i.gd.emit("plotly_selected",C),b&&i.selectionDefs&&(b.subtract=st,i.selectionDefs.push(b),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,_)),i.doneFnCompleted&&i.doneFnCompleted(ft)})).catch(v.error),U&&B(i)}},clearSelect:C,clearSelectionsCache:B,selectOnClick:P}},{"../../components/color":51,"../../components/dragelement/helpers":69,"../../components/drawing":73,"../../components/fx":91,"../../components/fx/helpers":87,"../../components/shapes/draw_newshape/display_outlines":136,"../../components/shapes/draw_newshape/helpers":137,"../../components/shapes/draw_newshape/newshapes":138,"../../lib":178,"../../lib/clear_gl_canvases":165,"../../lib/polygon":190,"../../lib/throttle":200,"../../plot_api/subroutines":213,"../../registry":272,"./axis_ids":225,"./constants":228,"./handle_outline":232,"./helpers":233,polybooljs:25}],242:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,p=t("../../constants/numerical"),h=p.FP_SAFE,f=p.BADNUM,d=p.LOG_CLIP,m=p.ONEDAY,y=p.ONEHOUR,g=p.ONEMIN,v=p.ONESEC,_=t("./axis_ids"),x=t("./constants"),b=x.HOUR_PATTERN,w=x.WEEKDAY_PATTERN;function T(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);function A(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*d*Math.abs(n-i))}return f}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===f){if(!i(e))return f;if(e=+e,(o||{}).msUTC)return e;var u=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-u/10);s=l(new Date(c))+u/10}return s}function S(e,r,n){return s(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function L(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f}function E(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=E(t);return void 0!==e?e:i(t)?+t:void 0}function I(t,e,r){return n.round(r+e*t,2)}function P(t,e,r){return(t-r)/e}var D=function(e){return i(e)?I(e,t._m,t._b):f},O=function(e){return P(e,t._m,t._b)};if(t.rangebreaks){var R="y"===p;D=function(e){if(!i(e))return f;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=R;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var p=t._B[s]||0;return isFinite(p)?I(e,t._m2,p):0},O=function(e){var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return P(e,t._m2,t._B[n])}}t.c2l="log"===t.type?A:u,t.l2c="log"===t.type?T:u,t.l2p=D,t.p2l=O,t.c2p="log"===t.type?function(t,e){return D(A(t,e))}:D,t.p2c="log"===t.type?function(t){return T(O(t))}:O,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=O,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return A(o(t),e)},t.r2d=t.r2c=function(t){return T(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=A,t.l2d=T,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return T(O(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=O,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=S,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return S(O(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,f,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=L,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(O(t))},t.r2p=t.d2p,t.p2r=O,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=E,t.l2r=t.c2r=u,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(O(t))},t.r2p=t.d2p,t.p2r=O,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=_.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),h="y"===p;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(h?c:u)),s=0;si&&(i+=7,si&&(i+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=a.simpleMap(e.yr0,l.r2l),_=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=i.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,A=h?f[1]:0,M=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":73,"../../lib":178,"../../registry":272,"./axes":222,d3:14}],247:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var f=a(u),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;p\xa9 OpenStreetMap',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under CC BY SA.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},i=Object.keys(n);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],256:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":178}],257:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),u=t("../../lib/svg_text_utils"),c=t("./mapbox"),p=r.constants=t("./constants");function h(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;l_/2){var x=m.split("|").join("
");g.text(x).attr("data-unformatted",x).call(u.convertToTspans,t),v=l.bBox(g.node())}g.attr("transform","translate(-3, "+(8-v.height)+")"),y.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>_&&(b=_/(v.width+6));var w=[n.l+n.w*c.x[1],n.t+n.h*(1-c.y[0])];y.attr("transform","translate("+w[0]+","+w[1]+") scale("+b+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates})},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.updateLayer=function(t){var e,r=this.subplot,n=c(t),i=this.subplot.belowLookup["layout-"+this.index];if("traces"===i)for(var a=r.getMapLayers(),s=0;s1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=p(o)?function(t,r){(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(u)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),f(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=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"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){v.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})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),v.linkSubplots(p,s,c,i),v.cleanPlot(p,s,c,i);var B=!(!i._has||!i._has("gl2d")),N=!(!s._has||!s._has("gl2d")),U=!(!i._has||!i._has("cartesian"))||B,j=!(!s._has||!s._has("cartesian"))||N;U&&!j?i._bgLayer.remove():j&&!U&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&h({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=v.layoutAttributes.width.min,f=v.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,p=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(p),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,p=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:p,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];if(!n._replotting)return v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),C(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,p=n.b,h=e.width,f=e.height,d=e._pushmargin,m=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var y in d)m[y]||delete d[y];for(var g in d.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:p}},d){var _=d[g].l||{},x=d[g].b||{},b=_.val,w=_.size,T=x.val,k=x.size;for(var A in d){if(i(w)&&d[A].r){var M=d[A].r.val,S=d[A].r.size;if(M>b){var L=(w*M+(S-h)*b)/(M-b),E=(S*(1-b)+(w-h)*(1-M))/(M-b);L>=0&&E>=0&&h-(L+E)>0&&L+E>s+u&&(s=L,u=E)}}if(i(k)&&d[A].t){var z=d[A].t.val,I=d[A].t.size;if(z>T){var P=(k*z+(I-f)*T)/(z-T),D=(I*(1-T)+(k-f)*(1-z))/(z-T);P>=0&&D>=0&&f-(D+P)>0&&P+D>p+c&&(p=P,c=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(p),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(f)-r.t-r.b,!e._replotting&&v.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var O=3*(1+Object.keys(m).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return a.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return a.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}v.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},v.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};return e||(p.layout=c(s)),t.framework&&t.framework.isPolar&&(p=t.framework.getConfig()),u&&(p.frames=c(u)),a&&(p.config=c(t._context,!0)),"object"===n?p:JSON.stringify(p)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(I(u,h,f),i=0;i=0?h.angularAxis.domain:n.extent(T),C=Math.abs(T[1]-T[0]);A&&!k&&(C=0);var L=S.slice();M&&k&&(L[1]+=C);var E=h.angularAxis.ticksCount||4;E>8&&(E=E/(E/8)+E%8),h.angularAxis.ticksStep&&(E=(L[1]-L[0])/E);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(E*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var I=n.range.apply(this,L);if(I=I.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?C:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"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){O=t.select(".legend-group").attr({transform:"translate("+[_,h.margin.top]+")"}).style({display:"block"});var N=f.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:f.map((function(t,e){return t.name||"Element"+e})),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:h.legend.reverseOrder})})();var U=O.node().getBBox();_=Math.min(h.width-U.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,_=Math.max(10,_),b=[h.margin.left+_,h.margin.top+_],r.range([0,_]),c.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[b[0]+_,b[1]-_]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+b+")").style({cursor:"crosshair"});var j=[(h.width-(h.margin.left+h.margin.right+2*_+(U?U.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*_))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),t.select(".outer-group").attr("transform","translate("+j+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(B).text(h.title.text),q=V.node().getBBox();V.attr({x:b[0]-q.width/2,y:b[1]-_-20})}var Z=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=Z.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}Z.select("circle.outside-circle").attr({r:_}).style(F);var H=t.select("circle.background-circle").attr({r:_}).style({fill:h.backgroundColor,stroke:h.stroke});function X(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);Z.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Z.selectAll(".domain").style(F),Z.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(B).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,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Z.selectAll("g>line").style({stroke:"black"})}var Y=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),K=Y.enter().append("g").classed("angular-tick",!0);Y.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Y.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(F),K.selectAll(".minor").style({stroke:h.minorTickColor}),Y.select("line.grid-line").attr({x1:h.tickLength?_-h.tickLength:0,x2:_}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var J=Y.select("text.axis-text").attr({x:_+h.labelOffset,dy:a+"em",transform:function(t,e){var r=X(t),n=_+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&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?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(B);h.angularAxis.rewriteTicks&&J.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var Q=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));O.attr({transform:"translate("+[_+Q,h.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(f);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),f[0]||$){var et=[];f.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.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 i(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var pt=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(H).angle;pt.attr({x2:-_,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(_+12,r+180);lt.text(o.util.round(it)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(H).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(H).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,p=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),f=[p.left+p.width/2-j[0]-h.left,p.top+p.height/2-j[1]-h.top];ct.config({color:s}).text(c),ct.move(f)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)})),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,p,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).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},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var p=e.angularScale.range(),h=Math.abs(p[1]-p[0])/o[0].length*Math.PI/180,f=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:f,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);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(d).each(u[e.geometryType]),y.exit().remove(),m.exit().remove()}))}return a.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)})),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a}))})),o=n.merge(a);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,p=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),f=h.enter().append("svg").attr({width:300,height:p+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});f.append("g").classed("legend-axis",!0),f.append("g").classed("legend-marks",!0);var d=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(d).range(l),y=n.scale[c?"linear":"ordinal"]().domain(d)[c?"range":"rangePoints"]([0,p]);if(c){var g=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);g.enter().append("stop"),g.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var v=h.select(".legend-marks").selectAll("path.legend-mark").data(o);v.enter().append("path").classed("legend-mark",!0),v.attr({transform:function(t,e){return"translate("+[u/2,y(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return m(e)}}),v.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(_);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",p=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(p);var h=a.padding,f=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},m=f.width+2*h+l,y=f.height+2*h;return r.attr({d:"M"+[[l,-y/2],[l,-y/4],[a.hasTick?0:l,0],[l,y/4],[l,y/2],[m,y/2],[m,-y/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-y/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=i({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 a=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=i({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}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}};return t}},{"../../../constants/alignment":153,"../../../lib":178,d3:14}],268:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,p=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,p.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){p.undo()},h.redo=function(){p.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":51,"../../../lib":178,"./micropolar":267,"./undo_manager":269,d3:14}],269:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],i=0;i-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":51,"../components/drawing":73,"../constants/xmlns_namespaces":157,"../lib":178,d3:14}],281:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":50,"../../components/colorscale/attributes":58,"../../lib/extend":171,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattergeo/attributes":330}],282:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o,h.mockAxis),[t]}},{"../../lib":178,"../../plots/cartesian/axes":222,"./attributes":281}],285:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":255,"./convert":287}],291:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":58,"../../lib/extend":171,"../../plots/attributes":219,"../../plots/template_attributes":271,"../scattermapbox/attributes":332}],292:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=i(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c")}(u,c,l[0].t.labels),[s]}}},{"../../lib":178,"../../plots/cartesian/axes":222,"../scattermapbox/hover":337}],297:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":255,"./convert":293}],299:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],300:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;rs&&A[y].gap;)y--;for(v=A[y].s,d=A.length-1;d>y;d--)A[d].s=v;for(;sM[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],310:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),p=t("./line_defaults"),h=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var g=l(t,e,m,y);if(g||(e.visible=!1),e.visible){var v=u(t,e,m,y),_=!v&&gG!=(F=I[E][1])>=G&&(D=I[E-1][0],O=I[E][0],F-R&&(P=D+(O-D)*(G-R)/(F-R),j=Math.min(j,P),V=Math.max(V,P)));j=Math.max(j,0),V=Math.min(V,h._length);var H=s.defaultLine;return s.opacity(p.fillcolor)?H=p.fillcolor:s.opacity((p.line||{}).color)&&(H=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:j,x1:V,y0:G,y1:G,color:H,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":51,"../../components/fx":91,"../../lib":178,"../../registry":272,"./get_trace_color":313}],315:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":235,"./arrays_to_calcdata":302,"./attributes":303,"./calc":304,"./cross_trace_calc":308,"./cross_trace_defaults":309,"./defaults":310,"./format_labels":312,"./hover":314,"./marker_colorbar":321,"./plot":323,"./select":324,"./style":326,"./subtypes":327}],316:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"../../lib":178}],317:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,a,h,f,d,m,y,g,v,_,x,b,w,T,k,A,M,S=e.xaxis,C=e.yaxis,L="log"===S.type,E="log"===C.type,z=S._length,I=C._length,P=e.connectGaps,D=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,U=t.length,j=new Array(U),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?C.l2p(n.y):C.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;E&&l===i&&(a*=Math.abs(S._m*I*(S._m>0?o:s)/(C._m*z*(C._m>0?o:s)))),a*=1e3}if(l===i){if(E&&(l=C.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===j[V-1][0],i=r===j[V-1][1];if(!n||!i)if(V>1){var a=e===j[V-2][0],o=r===j[V-2][1];n&&(e===et||e===rt)&&a?o?V--:j[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:j[V-1]=t:j[V++]=t}else j[V++]=t}function ct(t){j[V-1][0]!==t[0]&&j[V-1][1]!==t[1]&&ut([Y,K]),ut(t),J=null,Y=K=0}function pt(t){if(A=t[0]/z,M=t[1]/I,X=t[0]rt?rt:0,W=t[1]it?it:0,X||W){if(V)if(J){var e=$(J,t);e.length>1&&(ct(e[0]),j[V++]=e[1])}else Q=$(j[V-1],t)[0],j[V++]=Q;else j[V++]=[X||t[0],W||t[1]];var r=j[V-1];X&&W&&(r[0]!==X||r[1]!==W)?(J&&(Y!==X&&K!==W?ut(Y&&K?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Y||X,K||W]):Y&&K&&ut([Y,K])),ut([X,W])):Y-X&&K-W&&ut([X||Y,W||K]),J=t,Y=X,K=W}else J&&ct($(J,t)[0]),j[V++]=t;var n,i,a,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&H(o,t)G(d,ht))break;a=d,(b=g[0]*y[0]+g[1]*y[1])>_?(_=b,h=d,m=!1):b=t.length||!d)break;pt(d),n=d}}else pt(h)}J&&ut([Y||J[0],K||J[1]]),B.push(j.slice(0,V))}return B}},{"../../constants/numerical":156,"../../lib":178,"./constants":307}],318:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],319:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(a=0;a=0?l=f:(l=f=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":16}],321:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],322:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":51,"../../components/colorscale/defaults":61,"../../components/colorscale/helpers":62,"./subtypes":327}],323:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),p=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var E=b.fill.charAt(b.fill.length-1);"x"!==E&&"y"!==E&&(E=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var z,I,P="",D=[],O=b._prevtrace;O&&(P=O._prevRevpath||"",L=O._nextFill,D=O._polygons);var R,F,B,N,U,j,V,q="",Z="",G=[],H=a.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(G.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",z).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",z),l.singleLineStyle(p,i)}}}}}var X=A.selectAll(".js-line").data(G);v(X.exit()).style("opacity",0).remove(),X.each(H(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(H(!0)),l.setClipUrl(X,r.layerClipId,t),G.length?(C?(C.datum(p),N&&j&&(E?("y"===E?N[1]=j[1]=x.c2p(0,!0):"x"===E&&(N[0]=j[0]=_.c2p(0,!0)),v(C).attr("d","M"+j+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(C).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===b.fill.substr(0,6)&&q&&P?("tonext"===b.fill?v(L).attr("d",q+"Z"+P+"Z").call(l.singleFillStyle):v(L).attr("d",q+"L"+P.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(D)):(Y(L),b._polygons=null)),b._prevRevpath=Z,b._prevPolygons=V):(C?Y(C):L&&Y(L),b._polygons=b._prevRevpath=b._prevPolygons=null),M.datum(p),S.datum(p),function(e,i,a){var o,c=a[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?J:K:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,_,x)?(l.singlePointStyle(e,a,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,_,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(M,W,t),l.setClipUrl(S,W,t)}function Y(t){v(t).attr("d","M0,0Z")}function K(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,m=!!a&&a.duration>0,y=p(t,e,r);((c=i.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,a)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,a)}));d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":73,"../../lib":178,"../../lib/polygon":190,"../../registry":272,"./line_points":317,"./link_traces":319,"./subtypes":327,d3:14}],324:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-c.c2p([d,a]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=l[t.index],y=m.lonlat,g=[i.modHalf(y[0],360)+f,y[1]],v=c.c2p(g),_=p.c2p(g),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(u,m),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(i||-1!==n.indexOf("text"))&&o(e,t,u);return u.join("
")}(u,m,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":91,"../../constants/numerical":156,"../../lib":178,"../scatter/get_trace_color":313}],338:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":257,"../scatter/marker_colorbar":321,"../scattergeo/calc":331,"./attributes":332,"./defaults":334,"./event_data":335,"./format_labels":336,"./hover":337,"./plot":339,"./select":340}],339:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],u=0;u 0) { var factor = 1 - 2 * frameMargins; @@ -212635,7 +212644,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[26])(26) }); diff --git a/dist/plotly.js b/dist/plotly.js index ae4836094c4..ac5cc817824 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.54.2 +* plotly.js v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -143088,6 +143088,15 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { )(layoutIn, layoutOut, coerce); }; +function getComputedSize(attr) { + return ( + (typeof attr === 'string') && + (attr.substr(attr.length - 2) === 'px') && + parseFloat(attr) + ); +} + + plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { var context = gd._context || {}; var frameMargins = context.frameMargins; @@ -143114,8 +143123,8 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) { // but don't enforce any ratio restrictions var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {}; - newWidth = parseFloat(computedStyle.width) || parseFloat(computedStyle.maxWidth) || fullLayout.width; - newHeight = parseFloat(computedStyle.height) || parseFloat(computedStyle.maxHeight) || fullLayout.height; + newWidth = getComputedSize(computedStyle.width) || getComputedSize(computedStyle.maxWidth) || fullLayout.width; + newHeight = getComputedSize(computedStyle.height) || getComputedSize(computedStyle.maxHeight) || fullLayout.height; if(isNumeric(frameMargins) && frameMargins > 0) { var factor = 1 - 2 * frameMargins; @@ -207686,7 +207695,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '1.54.2'; +exports.version = '1.54.3'; },{}]},{},[26])(26) }); diff --git a/dist/plotly.min.js b/dist/plotly.min.js index 7bcf27ec771..c33be29a710 100644 --- a/dist/plotly.min.js +++ b/dist/plotly.min.js @@ -1,5 +1,5 @@ /** -* plotly.js v1.54.2 +* plotly.js v1.54.3 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -58,4 +58,4 @@ var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t(" * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,a="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||"undefined"==typeof n)n=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],501:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],502:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r,o=t[a];(l=o-((r=i+o)-i))&&(t[--n]=r,r=l)}var s=0;for(a=n;a>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function u(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",c(l(t)),")};return robustDeterminant",t].join(""))(a,i,n,o)}var h=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;h.length<6;)h.push(u(h.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,h.concat([h,u])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(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 c(e,t)}function u(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===a?r.push("+b[",i,"]"):r.push("+A[",i,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var i=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;i.length<6;)i.push(a(i.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,i.concat([i,a])),n=0;n<6;++n)e.exports[n]=i[n]}()},{"robust-determinant":503}],507:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],d=i*c,g=o*l,m=o*s,v=a*c,y=a*l,x=i*s,b=u*(d-g)+h*(m-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(u)+(Math.abs(m)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:f(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}!function(){for(;p.length<=5;)p.push(u(p.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),c=r[a],u=n[a],h=Math.min(c,u);if(Math.max(c,u)=n?(a=h,(l+=1)=n?(a=h,(l+=1)0?1:0}},{}],514:[function(t,e,r){"use strict";e.exports=function(t){return a(n(t))};var n=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":98,"reduce-simplicial-complex":494}],515:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,"undefined"==typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",a[0],"],c[",a[1],"])")}l.push("]")}l.push(");")}}for(i=t+1;i>1;--i){i>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function u(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[m],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],a=(1<>>u&1&&c.push(a[u]);e.push(c)}return s(e)},r.skeleton=h,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return m(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}var k=[],A=new Array(i);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=A[e],a=A[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:E,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":507,"simplicial-complex":519}],522:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),c=n(r,i,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,i),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,a=u.value):(a=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return a;p=h[f]}}if(p.start)if(s){var d=i(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(a=p.index)}else a=p.index;else p.y!==t[1]&&(a=p.index)}}}return a}},{"./lib/order-segments":522,"binary-search-bounds":523,"functional-red-black-tree":243,"robust-orientation":507}],525:[function(t,e,r){"use strict";var n=t("robust-dot-product"),a=t("robust-sum");function i(t,e){var r=a(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var a=-e/(n-e);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=t.length,s=new Array(o),l=0;l0||a>0&&u<0){var h=o(s,u,l,a);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(a,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(a,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":504,"robust-sum":512}],526:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,c,u,h,f,p=1,d=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",a=a.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+a).length,l=s.width&&u>0?c.repeat(u):"",g+=s.align?f+a+l:"0"===c?f+l+a:l+f+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],527:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(i[e]=0&&s[e].push(o[g])}i[e]=d}else{if(n[e]===r[e]){var m=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(a[x]=!1,m.push(x),v.push(s[x]),y+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(m);var b=new Array(y);for(d=0;d c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){");for(c=0;c<1<<(1<128&&c%128==0){h.length>0&&f.push("}}");var p="vExtra"+h.length;i.push("case ",c>>>7,":",p,"(m&0x7f,",l.join(),");break;"),f=["function ",p,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&c,":");for(var d=new Array(r),g=new Array(r),m=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+m[b]+"*c");var M=d[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+M+"*("+d[b].join("+")+A+")/("+g[b].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}i.push("}},"),h.length>0&&f.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,g=void 0===d?0:d,m=t.sweepFlag,v=void 0===m?0:m,y=[];if(0===u||0===h)return[];var x=Math.sin(p*a/360),b=Math.cos(p*a/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));var k=function(t,e,r,n,i,o,l,c,u,h,f,p){var d=Math.pow(i,2),g=Math.pow(o,2),m=Math.pow(f,2),v=Math.pow(p,2),y=d*g-d*v-g*m;y<0&&(y=0),y/=d*v+g*m;var x=(y=Math.sqrt(y)*(l===c?-1:1))*i/o*p,b=y*-o/i*f,_=h*x-u*b+(t+r)/2,w=u*x+h*b+(e+n)/2,T=(f-x)/i,k=(p-b)/o,A=(-f-x)/i,M=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,A,M);return 0===c&&E>0&&(E-=a),1===c&&E<0&&(E+=a),[_,w,S,E]}(e,r,l,c,u,h,g,v,x,b,_,w),A=n(k,4),M=A[0],S=A[1],E=A[2],C=A[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var P=Math.max(Math.ceil(L),1);C/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":63,assert:71,"is-svg-path":428,"normalize-svg-path":532,"parse-svg-path":465}],532:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,h=null,f=0,p=0,d=0,g=t.length;d4?(o=m[m.length-4],s=m[m.length-3]):(o=f,s=p),r.push(m)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":530}],533:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,h;e.shape?(r=e.shape[0],h=e.shape[1]):(r=c.width=e.w||e.width||200,h=c.height=e.h||e.height||200);var f=Math.min(r,h),p=e.stroke||0,d=e.viewbox||e.viewBox||a(t),g=[r/(d[2]-d[0]),h/(d[3]-d[1])],m=Math.min(g[0]||0,g[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,h),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*h),u.scale(m,m),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=i(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}},{"bitmap-sdf":96,"draw-svg-path":170,"is-svg-path":428,"parse-svg-path":465,"svg-path-bounds":531}],534:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(h+=.02);var p=new Float32Array(u),d=0,g=-.5*h;for(f=0;f1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,u),h=!0,f="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,d,g;return i=C(i),{ok:h,format:e.format||f,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),c=(i+l)/2;if(i==l)n=a=0;else{var u=i-l;switch(a=c>.5?u/(2-i-l):u/(i+l),i){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[z(i(t).toString(16)),z(i(e).toString(16)),z(i(r).toString(16)),z(D(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_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(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:O(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function V(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],536:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[a,i,o,s]}function a(t,e){var r=e.id,n=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(t,e){var n=r(t.transform),a=t.arcs;function i(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],i=0,o=r.length;i1)n=l(t,e,r);else for(a=0,n=new Array(i=t.arcs.length);a1)for(var i,s,c=1,u=l(a[0]);cu&&(s=a[0],a[0]=a[c],a[c]=s,u=i);return a})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[a]=2))throw new Error("n must be \u22652");var r,a=(l=t.bbox||n(t))[0],i=l[1],o=l[2],s=l[3];e={scale:[o-a?(o-a)/(r-1):1,s-i?(s-i)/(r-1):1],translate:[a,i]}}var l,c,u=h(e),f=t.objects,p={};function d(t){return u(t)}function g(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(g)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)p[c]=g(f[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,a=t.length,i=new Array(a);for(i[0]=u(t[0],0);++rMath.max(r,n)?a[2]=1:r>Math.max(e,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=t[l]*t[l],o+=a[l]*t[l];for(l=0;l<3;++l)a[l]-=o/i*t[l];return s(a,a),a}function f(t,e,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.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,n=0,a=0,i=0;i<3;++i)a+=e[i]*r[i],n+=e[i]*e[i];var l=Math.sqrt(n),u=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,u+=r[i]*r[i],e[i]/=l;var h=Math.sqrt(u);for(i=0;i<3;++i)r[i]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],m=Math.cos(d),v=Math.sin(d),y=Math.cos(g),x=Math.sin(g),b=this.computedCenter,_=m*y,w=v*y,T=x,k=-m*x,A=-v*x,M=y,S=this.computedEye,E=this.computedMatrix;for(i=0;i<3;++i){var C=_*r[i]+w*f[i]+T*e[i];E[4*i+1]=k*r[i]+A*f[i]+M*e[i],E[4*i+2]=C,E[4*i+3]=0}var L=E[1],P=E[5],I=E[9],z=E[2],O=E[6],D=E[10],R=P*D-I*O,F=I*z-L*D,B=L*O-P*z,N=c(R,F,B);R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B;for(i=0;i<3;++i)S[i]=b[i]+E[2+4*i]*p;for(i=0;i<3;++i){u=0;for(var j=0;j<3;++j)u+=E[i+4*j]*S[j];E[12+i]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;d[0]=a[2],d[1]=a[6],d[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)a[4*c]=o[c],a[4*c+1]=s[c],a[4*c+2]=l[c];i(a,a,n,d);for(c=0;c<3;++c)o[c]=a[4*c],s[c]=a[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=c(i,o,s);i/=l,o/=l,s/=l;var u=a[0],h=a[4],f=a[8],p=u*i+h*o+f*s,d=c(u-=i*p,h-=o*p,f-=s*p),g=(u/=d)*e+i*r,m=(h/=d)*e+o*r,v=(f/=d)*e+s*r;this.center.move(t,g,m,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),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,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[i],l=e[i+4],h=e[i+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),g=Math.max(f,p,d);f===g?(s=s<0?-1:1,l=h=0):d===g?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var m=c(s,l,h);s/=m,l/=m,h/=m}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*h,T=c(x-=s*w,b-=l*w,_-=h*w),k=l*(_/=T)-h*(b/=T),A=h*(x/=T)-s*_,M=s*b-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,b,_),2===i){var E=e[1],C=e[5],L=e[9],P=E*x+C*b+L*_,I=E*k+C*A+L*M;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var z=e[2],O=e[6],D=e[10],R=z*s+O*l+D*h,F=z*x+O*b+D*_,B=z*k+O*A+D*M;v=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;a(U,e);var q=U[15],H=U[12]/q,G=U[13]/q,Y=U[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-j*W,Y-V*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,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=c(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,g=d[0],m=d[1],v=d[2],y=a*g+i*m+o*v,x=c(g-=y*a,m-=y*i,v-=y*o);if(!(x<.01&&(x=c(g=i*f-o*h,m=o*l-a*f,v=a*h-i*l))<1e-6)){g/=x,m/=x,v/=x,this.up.set(t,a,i,o),this.right.set(t,g,m,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=i*v-o*m,_=o*g-a*v,w=a*m-i*g,T=c(b,_,w),k=a*l+i*h+o*f,A=g*l+m*h+v*f,M=(b/=T)*l+(_/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(M,A),C=this.angle._state,L=C[C.length-1],P=C[C.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-E),z=Math.abs(L-E),O=Math.abs(L-2*Math.PI-E);I":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":545}],547:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":553}],548:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":544,"./is":549}],549:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":543}],550:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":547}],551:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":547,"../value/is":553}],552:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":544,"./is":553}],553:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],554:[function(t,e,r){(function(e){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var u=c.DATA,h=c.BUFFER;function f(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function g(t){return new Uint16Array(p(2*t),0,t)}function m(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))h[n.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|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){f(t.buffer)},r.freeArrayBuffer=f,r.freeBuffer=function(t){h[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return g(t);case"uint32":return m(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=g,r.mallocUint32=m,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":95,buffer:108,dup:172}],555:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",f(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(p=0;p-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,l-s),n=n.replace("?px ",S())),g+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf("+"),u=r.indexOf("+"),h=c>-1?parseInt(t[1+c]):0,f=u>-1?parseInt(r[1+u]):0;h!==f&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,f-h),n=n.replace("?px ",S())),g-=.25*x*(f-h)}if(!0===o.bolds){var p=t.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!p&&d&&(n=v?n.replace("italic ","italic bold "):"bold "+n),p&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var v=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!v&&y&&(n="italic "+n),v&&!y&&(n=n.replace("italic ",""))}e.font=n}for(f=0;f",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(a,c))&&-1!==(u=r.indexOf(i,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,d=r.substr(p,u-p).indexOf(a);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function h(t,e,r,n){var a=u(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[i]:a}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,a){var i,o=v(n);return o?o[r]=a:(i=t.indexOf(n))>=0?e[i]=a:(i=t.length,e[i]=a,t[i]=n),this}))},delete___:{value:y((function(n){var a,i,o=v(n);return o?r in o&&delete o[r]:!((a=t.indexOf(n))<0)&&(i=t.length-1,t[a]=void 0,e[a]=e[i],t[a]=t[i],t.length=i,e.length=i,!0)}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof d||x();var e,n=new r,a=void 0,i=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(a||(a=new d),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new d),a.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){f||"undefined"==typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],562:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":563}],563:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],564:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":562}],565:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":245}],566:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=f[o-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(a=i.newDate(l,c,u)).add(4-(a.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=h[t-h[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=h[o.year-h[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=f[a.year-f[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=f[i.year-f[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);l=Math.round((u-c)/864e5);var p,d=h[i.year-h[0]];for(p=0;p<13;p++){var g=d&1<<12-p?30:29;if(l>13;!m||p=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":580,"object-assign":459}],569:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":580,"object-assign":459}],570:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":580,"object-assign":459}],571:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=i},{"../main":580,"object-assign":459}],572:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":580,"object-assign":459}],573:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=i},{"../main":580,"object-assign":459}],574:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=i},{"../main":580,"object-assign":459}],575:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":580,"object-assign":459}],577:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":580,"object-assign":459}],578:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":580,"object-assign":459}],579:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":580,"object-assign":459}],580:[function(t,e,r){var n=t("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new a;c.cdate=i,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":459}],581:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,h=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(p(t,n))for(;a.length1},x=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(A).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,i){for(var o=y(t,i)?n:r,s=0;s-1){p=1,d=g;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":580,"object-assign":459}],582:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":148}],583:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":582}],584:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],585:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":773,"../../plots/cartesian/constants":789,"../../plots/font_attributes":811,"./arrow_paths":584}],586:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],h=t["_"+i+"padminus"],f={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+f,g=p-f,m=3*t.startarrowsize*t.arrowwidth||0,v=m+f,y=m-f;if(c===l){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:g}),b=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(h,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(h,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":735,"../../plots/cartesian/axes":783,"./draw":591}],587:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var H=!1,G=["x","y"],Y=0;Y1)&&(tt===$?((ct=et.r2fraction(e["a"+Q]))<0||ct>1)&&(H=!0):H=!0),W=et._offset+et.r2p(e[Q]),J=.5}else"x"===Q?(X=e[Q],W=b.l+b.w*X):(X=1-e[Q],W=b.t+b.h*X),J=e.showarrow?.5:X;if(e.showarrow){lt.head=W;var ut=e["a"+Q];K=nt*V(.5,e.xanchor)-at*V(.5,e.yanchor),tt===$?(lt.tail=et._offset+et.r2p(ut),Z=K):(lt.tail=W+ut,Z=K+ut),lt.text=lt.tail+K;var ht=x["x"===Q?"width":"height"];if("paper"===$&&(lt.head=o.constrain(lt.head,1,ht-1)),"pixel"===tt){var ft=-Math.max(lt.tail-3,lt.text),pt=Math.min(lt.tail+3,lt.text)-ht;ft>0?(lt.tail+=ft,lt.text+=ft):pt>0&&(lt.tail-=pt,lt.text-=pt)}lt.tail+=st,lt.head+=st}else Z=K=it*V(J,ot),lt.text=W+K;lt.text+=st,K+=st,Z+=st,e["_"+Q+"padplus"]=it/2+Z,e["_"+Q+"padminus"]=it/2-Z,e["_"+Q+"size"]=it,e["_"+Q+"shift"]=K}if(H)z.remove();else{var dt=0,gt=0;if("left"!==e.align&&(dt=(w-v)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(I-y)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:R+dt-1,y:R+gt}).call(c.setClipUrl,B?M:null,t);else{var mt=R+gt-d.top,vt=R+dt-d.left;U.call(h.positionText,vt,mt).call(c.setClipUrl,B?M:null,t)}N.select("rect").call(c.setRect,R,R,w,I),F.call(c.setRect,O/2,O/2,D-O,j-O),z.call(c.setTranslate,Math.round(S.x.text-D/2),Math.round(S.y.text-j/2)),L.attr({transform:"rotate("+E+","+S.x.text+","+S.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=S.x.head,h=S.y.head,f=S.x.tail+r,d=S.y.tail+n,v=S.x.text+r,y=S.y.text+n,x=o.rotationXYMatrix(E,v,y),w=o.apply2DTransform(x),M=o.apply2DTransform2(x),P=+F.attr("width"),I=+F.attr("height"),O=v-.5*P,D=O+P,R=y-.5*I,B=R+I,N=[[O,R,O,B],[O,B,D,B],[D,B,D,R],[D,R,O,R]].map(M);if(!N.reduce((function(t,e){return t^!!o.segmentsIntersect(u,h,u+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){N.forEach((function(t){var e=o.segmentsIntersect(f,d,u,h,t[0],t[1],t[2],t[3]);e&&(f=e.x,d=e.y)}));var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,q=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),H=q.append("path").attr("d","M"+f+","+d+"L"+u+","+h).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(g(H,U,e),_.annotationPosition&&H.node().parentNode&&!i){var G=u,Y=h;if(e.standoff){var W=Math.sqrt(Math.pow(u-f,2)+Math.pow(h-d,2));G+=e.standoff*(f-u)/W,Y+=e.standoff*(d-h)/W}var Z,X,J=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-G)+","+(d-Y),transform:"translate("+G+","+Y+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);Z=t.x,X=t.y,s&&s.autorange&&T(s._name+".autorange",!0),m&&m.autorange&&T(m._name+".autorange",!0)},moveFn:function(t,r){var n=w(Z,X),a=n[0]+t,i=n[1]+r;z.call(c.setTranslate,a,i),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),k("y",m?m.p2r(m.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",m.p2r(m.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+E+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&xt(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",m.p2r(m.r2p(e.ay)+r)):k("ay",e.ay+r),xt(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-l/2;a=p.align(c+t/b.w,l,0,1,e.xanchor)}if(m)o=m.p2r(m.r2p(e.y)+r);else{var u=e._ysize/b.h,h=e.y-(e._yshift+e.yshift)/b.h-u/2;o=p.align(h-r/b.h,u,0,1,e.yanchor)}k("x",a),k("y",o),s&&m||(n=p.getCursor(s?.5:a,m?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),f(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){f(z),a.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,m=e.indexOf("end")>=0,v=h.backoff*p+r.standoff,y=f.backoff*d+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(c=(l=Math.atan2(b,x))+Math.PI,v&&y&&v+y>Math.sqrt(x*x+b*b))return void P();if(v){if(v*v>x*x+b*b)return void P();var _=v*Math.cos(l),w=v*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void P();var T=y*Math.cos(l),k=y*Math.sin(l);o.x-=T,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),M="";if(A1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":834,"../annotations/draw":591}],598:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>u&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var X=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));Y*=X*c.roundUp(Z/X,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Y}G.domain=[U+N,U+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,K=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),Q=t.select("."+k.cbaxis),$=0;function tt(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===A?(1-(U+R-N))*l.h+l.t+3+.75*n:(1-(U+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+k.cbtitle),o=i.select("text"),u=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),h?($=f.bBox(h).height)>p&&(u[1]-=($-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&($=f.bBox(o.node()).height),$){if($+=5,"top"===A)G.domain[1]-=$/l.h,u[1]*=-1;else{G.domain[0]+=$/l.h;var d=g.lineCount(o);u[1]+=(1-d)*p}i.attr("transform","translate("+u+")"),G.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-l.t)+")");var v=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(P);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var y=M.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?M[0]:(P[i]+P[i-1])/2,i===P.length-1?M[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)f.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=E(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?I:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+m.width/2%1)+"h"+z).call(f.lineGroupStyle,m.width,S(t),m.dash)})),Q.selectAll("g."+G._id+"tick,path").remove();var b=j+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),T=s.makeTransFn(G),C=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:Q,path:s.makeTickPath(G,b,C),transFn:T}),s.drawLabels(r,G,{vals:w,layer:Q,transFn:T,labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,a=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2+f.bBox(Q.node()).width;if((J=K.select("text")).node()&&!J.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?f.bBox(o).width:f.bBox(K.node()).right-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-H;t.select("."+k.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:H-B,width:Math.max(s,2),height:Math.max(c+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:j,y:H+e.ypad+("top"===A?$:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-$,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var u=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-u)+","+l.t+")");var h={},d=w[e.yanchor],g=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=c*d,h.b=c*g):(h.t=h.b=0,h.yt=e.y+e.len*d,h.yb=e.y-e.len*g);var m=w[e.xanchor],v=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*v;else{var y=s-z;h.l=y*m,h.r=y*v,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*v}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,c)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":704,"../../lib":735,"../../lib/extend":726,"../../lib/setcursor":755,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../plots/cartesian/axis_defaults":785,"../../plots/cartesian/layout_attributes":797,"../../plots/cartesian/position_defaults":800,"../../plots/plots":846,"../../registry":866,"../color":602,"../colorscale/helpers":613,"../dragelement":621,"../drawing":624,"../titles":697,"./constants":604,d3:165,tinycolor2:535}],607:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":735}],608:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":603,"./defaults":605,"./draw":606,"./has_colorbar":607}],609:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===s,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,h=e.editTypeOverride||"",f=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(f+(r={z:"z",c:"color"}[s]));var p=s+"auto",d=s+"min",g=s+"max",m=s+"mid",v=(o(f+p),o(f+d),o(f+g),{});v[d]=v[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[d]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":751,"../colorbar/attributes":603,"./scales.js":617}],610:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,h=i(u),f=!1!==h.auto,p=h.min,d=h.max,g=h.mid,m=function(){return a.aggNums(Math.min,null,l)},v=function(){return a.aggNums(Math.max,null,l)};(void 0===p?p=m():f&&(p=u._colorAx&&n(p)?Math.min(p,m()):m()),void 0===d?d=v():f&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),f&&void 0!==g&&(d-g>g-p?p=g-(d-g):d-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}},{"../../lib":735,"./helpers":613,"fast-isnumeric":237}],611:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],619:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":735}],620:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],621:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,f,p,d,g,m=t.gd,v=1,y=m._context.doubleClickDelay,x=t.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(v=Math.max(v-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},l.coverSlip=u},{"../../lib":735,"../../plots/cartesian/constants":789,"./align":618,"./cursor":619,"./unhover":622,"has-hover":413,"has-passive-events":414,"mouse-event-offset":441}],622:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":724,"../../lib/events":725,"../../lib/throttle":760,"../fx/constants":636}],623:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],624:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),f=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),m=t("../../components/fx/helpers").appendArrayPointValue,v=e.exports={};v.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);v.translatePoint(t,a,e,r)}))},v.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){v.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(v.dashLine,l,o)}))},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;v.symbolList.push(r,t,r+100,t+"-open"),v.symbolNames[r]=t,v.symbolFuncs[r]=e.f,e.needLine&&(v.symbolNeedLines[r]=!0),e.noDot?v.symbolNoDot[r]=!0:v.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(v.symbolNoFill[r]=!0)}));var x=v.symbolNames.length;function b(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};v.gradient=function(t,e,r,a,o,l){for(var u=o.length,h=k[a],f=new Array(u),p=0;p"+v(t);d._gradientUrlQueryParts[y]=1},v.initGradients=function(t){var e=t._fullLayout;c.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},v.pointStyle=function(t,e,r){if(t.size()){var a=v.makePointStyleFns(e);t.each((function(t){v.singlePointStyle(t,n.select(this),e,a,r)}))}},v.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var u=v.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",b(u,l))}var h,f,p,d=!1;if(t.so)p=o.outlierwidth,f=o.outliercolor,h=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(h=s.defaultLine,d=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var m=i.gradient,y=t.mgt;if(y?d=!0:y=m&&m.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?d=!0:x=m.color;var _=r.uid;d&&(_+="-"+t.i),v.gradient(e,a,_,y,[[0,x],[1,h]],"fill")}else s.fill(e,h);p&&s.stroke(e,f)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,u=i.opacity,h=s.opacity,f=void 0!==u,d=void 0!==h;(c.isArrayOrTypedArray(l)||f||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:d?h:p*e});var g=a.color,m=i.color,v=s.color;(m||v)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?m||e:v||e});var y=a.size,x=i.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?c||e:u||(c?e:s.addOpacity(e,p))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",b(v.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=v.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var i=n.select(this),l=o?c.extractOption(t,e,"txt","texttemplate"):c.extractOption(t,e,"tx","text");if(l||0===l){if(o){var h=e._module.formatLabels?e._module.formatLabels(t,e,s):{},f={};m(f,e,t.i);var p=e._meta||{};l=c.texttemplateString(l,h,s._d3locale,f,t,p)}var d=t.tp||e.textposition,g=S(t,e),y=a?a(t):t.tc||e.textfont.color;i.call(v.font,t.tf||e.textfont.family,g,y).text(l).call(u.convertToTspans,r).call(M,d,g,t.mrc)}else i.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(a,i),M(a,o,l,t.mrc2||t.mrc)}))}};function E(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(s*s+l*l,.25),h=(u*u*i-c*c*s)*a,f=(u*u*o-c*c*l)*a,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&h/p),2),n.round(e[1]+(p&&f/p),2)],[n.round(e[0]-(d&&h/d),2),n.round(e[1]-(d&&f/d),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(v.savedBBoxes={},P=0),r&&(v.savedBBoxes[r]=m),P++,c.extendFlat({},m)},v.setClipUrl=function(t,e,r){t.attr("clip-path",z(e,r))},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var O=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(O,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var D=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(D);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":638,"../../constants/alignment":704,"../../constants/interactions":710,"../../constants/xmlns_namespaces":712,"../../lib":735,"../../lib/svg_text_utils":759,"../../registry":866,"../../traces/scatter/make_bubble_size_func":1157,"../../traces/scatter/subtypes":1164,"../color":602,"../colorscale":614,"./symbol_defs":625,d3:165,"fast-isnumeric":237,tinycolor2:535}],625:[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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:165}],626:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],627:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),h=0;h0;e.each((function(e){var h,f=e[0].trace,p=f.error_x||{},d=f.error_y||{};f.ids&&(h=function(t){return t.id});var g=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var m=n.select(this).selectAll("g.errorbar").data(e,h);if(m.exit().remove(),e.length){p.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(m,r.layerClipId,t),m.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(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),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var h=d.width;i="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(i+="m-"+h+",0h"+2*h),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var f=e.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var m=(p.copy_ystyle?d:p).width;i="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(i+="m0,-"+m+"v"+2*m),!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(s.duration).ease(s.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":1164,"../drawing":624,d3:165,"fast-isnumeric":237}],632:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":602,d3:165}],633:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":726,"../../plots/font_attributes":811,"./layout_attributes":643}],634:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexb[0]._length||tt<0||tt>w[0]._length)return f.unhoverRaw(t,e)}if(e.pointerX=$+b[0]._offset,e.pointerY=tt+w[0]._offset,O="xval"in e?g.flat(l,e.xval):g.p2c(b,$),D="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!a(O[0])||!a(D[0]))return o.warn("Fx.hover failed",e,t),f.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(F=0;FY&&(X.splice(0,Y),rt=X[0].distance),v&&0!==Z&&0===X.length){G.distance=Z,G.index=!1;var f=N._module.hoverPoints(G,q,H,"closest",u._hoverlayer);if(f&&(f=f.filter((function(t){return t.spikeDistance<=Z}))),f&&f.length){var p,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];a(m.x0)&&a(m.y0)&&(p=it(m),(!K.vLinePoint||K.vLinePoint.spikeDistance>p.spikeDistance)&&(K.vLinePoint=p))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=it(x),(!K.hLinePoint||K.hLinePoint.spikeDistance>p.spikeDistance)&&(K.hLinePoint=p))}}}}}function at(t,e){for(var r,n=null,a=1/0,i=0;i1||X.length>1)||"closest"===C&&Q&&X.length>1,At=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),Mt={hovermode:C,rotateLabels:kt,bgColor:At,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},St=E(X,Mt,t);g.isUnifiedHover(C)||(!function(t,e,r){var n,a,i,o,s,l,c,u=0,h=1,f=t.size(),p=new Array(f),d=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(h=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||h*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=a;for(m.push.apply(m,v),p.splice(o+1,1),c=0,s=m.length-1;s>=0;s--)c+=m[s].dp;for(i=c/m.length,s=m.length-1;s>=0;s--)m[s].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var w=b[s],T=w.datum;T.offset=w.dp,T.del=w.del}}}(St,kt?"xa":"ya",u),L(St,kt));if(e.target&&e.target.tagName){var Et=d.getComponentMethod("annotations","hasClickToShow")(t,bt);c(n.select(e.target),Et?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,xt))return;xt&&t.emit("plotly_unhover",{event:e,points:xt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:w,xvals:O,yvals:D})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:i,outerContainer:o},l=E(a,s,e.gd),c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,c=e.bgColor,f=e.container,p=e.outerContainer,d=e.commonLabelOpts||{},b=e.fontFamily||m.HOVERFONT,_=e.fontSize||m.HOVERFONTSIZE,w=t[0],T=w.xa,S=w.ya,E="y"===i.charAt(0)?"yLabel":"xLabel",L=w[E],P=(String(L)||"").split(" ")[0],I=p.node().getBoundingClientRect(),z=I.top,O=I.width,D=I.height,R=void 0!==L&&w.distance<=e.hoverdistance&&("x"===i||"y"===i);if(R){var F,B,N=!0;for(F=0;Fa.width-E?(v=a.width-E,s.attr("d","M"+(E-k)+",0L"+E+","+M+k+"v"+M+(2*A+x.height)+"H-"+E+"V"+M+k+"H"+(E-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(A+x.width/2)+"v"+M+(2*A+x.height)+"H-"+(A+x.width/2)+"V"+M+k+"H-"+k+"Z")}else{var C,P,I;"right"===S.side?(C="start",P=1,I="",v=T._offset+T._length):(C="end",P=-1,I="-",v=T._offset),y=S._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),s.attr("d","M0,0L"+I+k+","+k+"V"+(A+x.height/2)+"h"+I+(2*A+x.width)+"V-"+(A+x.height/2)+"H"+I+k+"V-"+k+"Z");var O,D=x.height/2,R=z-x.top-D,F="clip"+a._uid+"commonlabel"+S._id;if(v=0?$-=rt:$+=2*A;var nt=et.height+2*A,at=Q+nt>=D;return nt<=D&&(Q<=z?Q=S._offset+2*A:at&&(Q=D-nt)),tt.attr("transform","translate("+$+","+Q+")"),tt}var it=f.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return it.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(h.fill,h.addOpacity(c,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,b,_)})),it.exit().remove(),it.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,f=h.combine(h.opacity(o)?o:h.defaultLine,c),p=h.combine(h.opacity(t.color)?t.color:h.defaultLine,c),d=t.borderColor||h.contrast(f),g=C(t,R,i,a,L,e),m=g[0],v=g[1],y=e.select("text.nums").call(u.font,t.fontFamily||b,t.fontSize||_,t.fontColor||d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),T=0,M=0;if(v&&v!==m){w.call(u.font,t.fontFamily||b,t.fontSize||_,p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var S=w.node().getBoundingClientRect();T=S.width+2*A,M=S.height+2*A}else w.remove(),e.select("rect").remove();e.select("path").style({fill:f,stroke:d});var E,P,I=y.node().getBoundingClientRect(),F=t.xa._offset+(t.x0+t.x1)/2,B=t.ya._offset+(t.y0+t.y1)/2,N=Math.abs(t.x1-t.x0),j=Math.abs(t.y1-t.y0),V=I.width+k+A+T;if(t.ty0=z-I.top,t.bx=I.width+2*A,t.by=Math.max(I.height+2*A,M),t.anchor="start",t.txwidth=I.width,t.tx2width=T,t.offset=0,s)t.pos=F,E=B+j/2+V<=D,P=B-j/2-V>=0,"top"!==t.idealAlign&&E||!P?E?(B+=j/2,t.anchor="start"):t.anchor="middle":(B-=j/2,t.anchor="end");else if(t.pos=B,E=F+N/2+V<=O,P=F-N/2-V>=0,"left"!==t.idealAlign&&E||!P)if(E)F+=N/2,t.anchor="start";else{t.anchor="middle";var U=V/2,q=F+U-O,H=F-U;q>0&&(F-=q),H<0&&(F+=-H)}else F-=N/2,t.anchor="end";y.attr("text-anchor",t.anchor),T&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+F+","+B+")"+(s?"rotate("+x+")":""))})),it}function C(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=O(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var c=n._d3locale,u=t.hovertemplate||!1,h=t.hovertemplateLabels||t,f=t.eventData[0]||{};return u&&(l=(l=o.hovertemplateString(u,h,c,f,t.trace._meta)).replace(S,(function(e,r){return s=O(r,t.nameLength),""}))),[l,s]}function L(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],c=s*(k+A),h=c+s*(t.txwidth+A),f=0,p=t.offset;"middle"===i&&(c-=t.tx2width/2,h+=t.txwidth/2+A),e&&(p*=-T,f=t.offset*w),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(p-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+f)+","+(k+p)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+f)+"V"+(p-k)+"Z");var d=c+f,g=p+t.ty0-t.by/2+A,m=t.textAlign||"auto";"auto"!==m&&("left"===m&&"start"!==i?(a.attr("text-anchor","start"),d="middle"===i?-t.bx/2-t.tx2width/2+A:-t.bx-A):"right"===m&&"end"!==i&&(a.attr("text-anchor","end"),d="middle"===i?t.bx/2-t.tx2width/2-A:t.bx+A)),a.call(l.positionText,d,g),t.tx2width&&(r.select("text.name").call(l.positionText,h+s*A+f,p+t.ty0-t.by/2+A),r.select("rect").call(u.setRect,h+(s-1)*t.tx2width/2+f,p-t.by/2-1,t.tx2width,t.by+2))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var a=c(r,n);l(a)&&(t[e]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function I(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,f=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||f){var g=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(f){var m,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(m=c.pointerX,v=c.pointerY):(m=n._offset+y.x,v=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?h.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,A=p.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=m),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(d){var E,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(E=c.pointerX,C=c.pointerY):(E=n._offset+L.x,C=a._offset+L.y);var P,I,z=i.readability(L.color,g)<1.5?h.contrast(g):L.color,O=n.spikemode,D=n.spikethickness,R=n.spikecolor||z,F=p.getPxPosition(t,n);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(P=F,I=C),-1!==O.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function z(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function O(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":735,"../../lib/events":725,"../../lib/override_cursor":746,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../registry":866,"../color":602,"../dragelement":621,"../drawing":624,"../legend/defaults":654,"../legend/draw":655,"./constants":636,"./helpers":638,d3:165,"fast-isnumeric":237,tinycolor2:535}],640:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":735,"../color":602,"./helpers":638}],641:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,s=i("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!f&&!p&&!d)"independent"===k("pattern")&&(f=!0);m._hasSubplotGrid=f;var x,b,_="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),m._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,m,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,u,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,g=r.rows,m=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var m=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var v,y,x,b=_("orientation");"h"===b?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),_("traceorder",f),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",v),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,m,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(c,m,o,t,e)}}},{"../../lib":735,"../../plot_api/plot_template":773,"../../plots/layout_attributes":837,"../../registry":866,"./attributes":652,"./helpers":658}],655:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),h=t("../../lib/svg_text_utils"),f=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),g=d.LINE_SPACING,m=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){f(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&f(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],s=i.trace,l=o.traceIs(s,"pie-like"),u=s.index,f=r._main&&e._context.edits.legendText&&!l,d=r._maxNameLength;r.entries?n=i.text:(n=l?i.label:s.name,s._meta&&(n=a.templateString(n,s._meta)));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(f?T(n,d):n),h.positionText(g,p.textGap,0),f?g.call(h.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var s=i.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var c=o.getTransformIndices(s,"groupby"),h=c[c.length-1],f=a.keyedContainer(s,"transforms["+h+"].styles","target","value.name");f.set(i.trace._group,n),l=f.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,u)})):A(g,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function A(t,e,r,n){n._main||t.attr("data-notex",!0),h.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var f=c.bBox(i);o=f.height,s=f.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,l,.75*o+l)}else{var d=t.select(n?".legendtext":".legendtitletext"),m=h.lineCount(d),v=d.node();o=u*m,s=v?c.bBox(v).width:0;var y=u*((m-1)/2-.3);n?h.positionText(d,p.textGap,-y):h.positionText(d,p.titlePad+l,u+l)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function S(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,h="legend"+s._uid;if(e?(r=e.layer,h+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var f;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;f=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;f=y(e.entries,e)}var d=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!f.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=a.ensureSingleById(s._topdefs,"clipPath",h,(function(t){t.append("rect")})),E=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));E.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,L.font).text(L.text),A(P,C,t,e)}else C.selectAll(".legendtitletext").remove();var I=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(f);z.enter().append("g").attr("class","groups"),z.exit().remove();var O=z.selectAll("g.traces").data(a.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){e._main&&n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=b.isVertical(a),l=b.isGrouped(a),u=a.borderwidth,h=2*u,f=p.textGap,d=p.itemGap,g=2*(u+d),m=S(a),v=a.y<0||0===a.y&&"top"===m,y=a.y>1||1===a.y&&"bottom"===m;a._maxHeight=Math.max(v||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),x=f+a._width,a._width+=d+f+h,a._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,A=y||v,E=i.width/2;a._maxWidth=Math.max(T?A&&"left"===w?o.l+o.w:E:k?A&&"right"===w?o.r+o.w:E:o.w,2*f);var C=0,L=0;r.each((function(t){var e=t[0].width+f;C=Math.max(C,e),L+=e})),x=null;var P=0;if(l){var I=0,z=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+d+n/2+e),e+=n,t=Math.max(t,f+r[0].width)})),I=Math.max(I,e);var r=t+d;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,O+=I+a.tracegroupgap,I=e),c.setTranslate(this,z,O),z+=r})),a._width=Math.max(P,z)+u,a._height=O+I+g}else{var D=r.size(),R=L+h+(D-1)*da._maxWidth&&(P=Math.max(P,j),B=0,N+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+B,_[1]+u+N+e/2+d),j=B+r+d,B+=n,F=Math.max(F,e)})),R?(a._width=B+h,a._height=F+g):(a._width=Math.max(P,j)+h,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=t._context.edits,U=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=U?f:x||f+t[0].width;s||(a+=d/2),c.setRect(e,0,-r/2,a,r)}))}(t,z,O,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*m[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*m[n]})}(t)){var u,f,d,y,x=s._size,b=e.borderwidth,w=x.l+x.w*e.x-m[M(e)]*e._width,k=x.t+x.h*(1-e.y)-m[S(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var A=w,L=k;w=a.constrain(w,0,s.width-e._width),k=a.constrain(k,0,s.height-e._effHeight),w!==A&&a.log("Constrain legend.x to make legend fit inside graph"),k!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&c.setTranslate(g,w,k),I.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var P=e._effHeight;e._main||(P=e._height),E.attr({width:e._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:e._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,h,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var z,O,D,R=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*p.scrollBarMargin,B=e._height-e._effHeight,N=F/B,j=Math.min(e._scrollY||0,B);E.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+j}),c.setClipUrl(C,h,t),q(j,R,N),g.on("wheel",(function(){q(j=a.constrain(e._scrollY+n.event.deltaY/F*B,0,B),R,N),0!==j&&j!==B&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,D=j})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(j=function(t,e,r){var n=(r-e)/N+t;return a.constrain(n,0,B)}(D,z,O),R,N))}));I.call(V);var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,D=j)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,q(j=function(t,e,r){var n=(e-r)/N+t;return a.constrain(n,0,B)}(D,z,O),R,N))}));C.call(U)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=c.getTranslate(g);d=t.x,y=t.y},moveFn:function(t,r){var n=d+t,a=y+r;c.setTranslate(g,n,a),u=l.align(n,0,x.l,x.l+x.w,e.xanchor),f=l.align(a,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==u&&void 0!==f&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":f})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function q(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,e._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],t)}}},{"../../constants/alignment":704,"../../lib":735,"../../lib/events":725,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../../registry":866,"../color":602,"../dragelement":621,"../drawing":624,"./constants":653,"./get_legend_data":656,"./handle_click":657,"./helpers":658,"./style":660,d3:165}],656:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,c={},u=0,h=0,f=e._main;function p(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;s.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=e.width}return d?n:Math.min(a,r)};function m(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(c?[t]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(t){var e=n.select(this),r=t[0],a=g(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function v(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var f=(s.marker||{}).line,p=g(h(f.width,o.pts),f,5,2),d=i.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=f.color;var m=i.minExtend(o,{trace:d});u(c,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var c={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([t]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=n.select(this),p=l(a),d=p.colorscale,g=p.reversescale;if(d){if(!r){var m=d.length;u=0===c?d[g?m-1:0][1]:1===c?d[g?0:m-1][1]:d[Math.floor((m-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[c]||v[0]:v}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var n="legendfill-"+a.uid;o.gradient(t,e,n,f(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,m(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){m(t,this,"funnel")})).each((function(t){m(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:d?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){v(t,this,"funnelarea")})).each((function(t){v(t,this,"pie")})).each((function(t){var r,a,s=t[0],u=s.trace,h=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),d=u.contours,m=!1,v=!1,y=l(u),x=y.colorscale,b=y.reversescale;if(d){var _=d.coloring;"lines"===_?m=!0:p="none"===_||"heatmap"===_||d.showlines,"constraint"===d.type?h="="!==d._operation:"fill"!==_&&"heatmap"!==_||(v=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=h||v,k=p||m,A=w||!T?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(h||v?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h30v6h-30z").call(h?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,f(b),x,"fill")}}),p||m){var E=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:E}}),r=[i.minExtend(s,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(p||m?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(m?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,f(b),x,"stroke")}})})).each((function(t){var r,a,s=t[0],l=s.trace,u=c.hasMarkers(l),h=c.hasText(l),f=c.hasLines(l);function p(t,e,r,n){var a=i.nestedProperty(l,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(d&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(u||h||f){var m={},v={};if(u){m.mc=p("marker.color",g),m.mx=p("marker.symbol",g),m.mo=p("marker.opacity",i.mean,[.2,1]),m.mlc=p("marker.line.color",g),m.mlw=p("marker.line.width",i.mean,[0,5],2),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);m.ms=y,v.marker.size=y}f&&(v.line={width:p("line.width",g,[0,10],5)}),h&&(m.tx="Aa",m.tp=p("textposition",g),m.ts=10,m.tc=p("textfont.color",g),m.tf=p("textfont.family",g)),r=[i.minExtend(s,m)],(a=i.minExtend(l,v)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(h?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":735,"../../registry":866,"../../traces/pie/helpers":1119,"../../traces/pie/style_one":1125,"../../traces/scatter/subtypes":1164,"../color":602,"../colorscale/helpers":613,"../drawing":624,d3:165}],661:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function h(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=i.list(t,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,g=(1+d)/2,m=(1-d)/2;for(a=0;a1?(E=["toggleHover"],C=["resetViews"]):d?(S=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],C=["resetGeo"]):p?(E=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(S=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],C=["resetViewMapbox"]):v?E=["hoverClosestGl2d"]:g?E=["hoverClosestPie"]:_?(E=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):E=["toggleHover"];f&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=R[r+1];else if(t=n.pmax)e=R[r+1];else if(t0?f+c:c;return{ppad:c,ppadplus:u?d:g,ppadminus:u?g:d}}return{ppad:c}}function u(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,h,f=1/0,p=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=h)));return p>=f?[f,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=h,E="y0",A=y,C="y1"):(k=y,E="y1",A=h,C="y0");W(n),J(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Y.moveFn="move"===z?Z:X,Y.altKey=n.altKey},doneFn:function(){if(v(t))return;p(e),K(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;K(s)}};function W(r){if(v(t))z=null;else if(R)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Y.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-s/i):"move";p(e,l),z=l.split("-")[0]}}function Z(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;O?B("xanchor",r.xanchor=q(x+n)):(o=function(t){return q(V(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=H(T+a)):(l=function(t){return H(U(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else O?B("xanchor",r.xanchor=q(x+n)):(B("x0",r.x0=q(c+n)),B("x1",r.x1=q(m+n))),D?B("yanchor",r.yanchor=H(T+a)):(B("y0",r.y0=H(h+a)),B("y1",r.y1=H(y+a)));e.attr("d",_(t,r)),J(s,r)}function X(n,a){if(F){var i=function(t){return t},o=i,l=i;O?B("xanchor",r.xanchor=q(x+n)):(o=function(t){return q(V(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=H(T+a)):(l=function(t){return H(U(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===z){var u=c+n,f=D?h-a:h+a;B("x0",r.x0=O?u:q(u)),B("y0",r.y0=D?f:H(f))}else if("resize-over-end-point"===z){var p=m+n,d=D?y-a:y+a;B("x1",r.x1=O?p:q(p)),B("y1",r.y1=D?d:H(d))}}else{var v=function(t){return-1!==z.indexOf(t)},b=v("n"),G=v("s"),Y=v("w"),W=v("e"),Z=b?k+a:k,X=G?A+a:A,K=Y?M+n:M,Q=W?S+n:S;D&&(b&&(Z=k-a),G&&(X=A-a)),(!D&&X-Z>10||D&&Z-X>10)&&(B(E,r[E]=D?Z:H(Z)),B(C,r[C]=D?X:H(X))),Q-K>10&&(B(L,r[L]=O?K:q(K)),B(P,r[P]=O?Q:q(Q)))}e.attr("d",_(t,r)),J(s,r)}function J(t,e){(O||D)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(O?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,d.paramIsX))),o=U(D?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,d.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),O&&D){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(O){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}f.init(Y),G.node().onmousemove=W}(t,O,l,e,r,z):!0===l.editable&&O.style("pointer-events",P||c.opacity(S)*M<=.5?"stroke":"all");O.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,m(t)}}(t,O)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,c,u,h,f=e.type,p=i.getFromId(t,e.xref),m=i.getFromId(t,e.yref),v=t._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(t){return p._offset+p.r2p(r(t,!0))}):n=function(t){return v.l+v.w*t},m?(o=g.shapePositionToRange(m),s=function(t){return m._offset+m.r2p(o(t,!0))}):s=function(t){return v.t+v.h*(1-t)},"path"===f)return p&&"date"===p.type&&(n=g.decodeDate(n)),m&&"date"===m.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],h=d.paramIsY[c],f=d.numParams[c],p=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===i?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,c=y+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);u=x-e.y0,h=x-e.y1}else u=s(e.y0),h=s(e.y1);if("line"===f)return"M"+l+","+u+"L"+c+","+h;if("rect"===f)return"M"+l+","+u+"H"+c+"V"+h+"H"+l+"Z";var b=(l+c)/2,_=(u+h)/2,w=Math.abs(b-l),T=Math.abs(_-u),k="A"+w+","+T,A=b+w+","+_;return"M"+A+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+A+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&h(v),r.attr("d",g(e)),A&&!f)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function S(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=s.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+u.groupClassName).data(r,m);l.enter().append("g").classed(u.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform","translate("+m+")")}}}return O.call(D),I&&(S?O.on(".opacity",null):(k=0,A=!0,O.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),O.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,m,e,y):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(D)})).on("input",(function(t){this.text(t||" ").call(u.positionText,b.x,b.y)}))),O.classed("js-placeholder",A),w}}},{"../../constants/alignment":704,"../../constants/interactions":710,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../../registry":866,"../color":602,"../drawing":624,d3:165,"fast-isnumeric":237}],698:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plot_api/plot_template":773,"../../plots/font_attributes":811,"../../plots/pad_attributes":845,"../color/attributes":601}],699:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],700:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":735,"../../plots/array_container_defaults":779,"./attributes":698,"./constants":699}],701:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,h=t("./constants"),f=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,c(t.layout,h.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(a.attr(h.menuIndexAttrName,"-1"),m(t,n,a,i,e),s||v(t,n,a,i,e))}function m(t,e,r,n,a){var i=s.ensureSingle(e,"g",h.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,c=a.active,u=a.buttons[c]||h.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};i.call(y,a,u,t).call(M,a,f,p),s.ensureSingle(e,"text",h.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(h.arrowSymbol[a.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+a.pad.l,y:l.headerHeight/2+h.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),v(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?h.dropdownButtonClassName:h.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,m=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=v.headerHeight+h.gapButtonHeader:d=v.headerWidth+h.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-h.gapButtonHeader+h.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-h.gapButtonHeader+h.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+m+o.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(M,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,s,l,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+h.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+h.headerGroupClassName).data(r,p);l.enter().append("g").classed(h.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",h.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=m+v;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,z=d+g,O=m;z+P>l&&(z=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:O,width:P,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?h+P+.5:h+.5,N=f-.5,j=k?p+M+.5:p+.5,V=o._topdefs.selectAll("#"+R).data(k||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),k||L?(this._clipRect=V.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||L){var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),L&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":735,"../color":602,"../drawing":624,d3:165}],704:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],705:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],706:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],707:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],708:[function(t,e,r){"use strict";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]}},{}],709:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],710:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],711:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],712:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],713:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],716:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],717:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return i(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function h(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,h,f,p,d,g=l([r,n]);function m(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,h=o,f=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return h(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return h(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return h(t,e,r,n,a,i,1)}}},{"./mod":742}],718:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var L;k=Number(k);try{var P=m.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),L=P.newDate(k,P.toMonthIndex(k,A,I),M)}else L=P.newDate(k,Number(A),M)}catch(t){return u}return L?(L.toJD()-g)*h+S*f+E*p+C*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?u:z.getTime()+C*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*h,k=3*f,A=5*p;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/h)+g,E=Math.floor(l(t,h));try{i=m.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+h&&t<=a-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function E(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=m.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/f),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+E(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return E(e,t,n,a)};var L=3*h;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var a=Math.round(t/h)+g,i=m.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+L);return c.setUTCMonth(c.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,c=_(e)&&m.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=f.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(f.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||g<0||g>1?null:{x:t+l*g,y:e+h*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(s(t,e,r,n,a,i,o,c))return 0;var u=r-t,h=n-e,f=o-a,p=c-i,d=u*u+h*h,g=f*f+p*p,m=Math.min(l(u,h,d,a-t,i-e),l(u,h,d,o-t,c-e),l(f,p,g,t-a,e-i),l(f,p,g,r-a,n-i));return Math.sqrt(m)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(o(r,e)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=a:f=a,h++}return i}},{"./mod":742}],732:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=i(s);function u(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return c;var e=i(t);return e.length?e:c}function f(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,p,d,g=t.color,m=l(g),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):h,a=m?function(t,e){return void 0===t[e]?c:i(n(t[e]))}:h,s=v?function(t,e){return void 0===t[e]?1:f(t[e])}:f,m||v)for(var b=0;bo?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*c[n];u[r]=i}return u},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var a;return C.test(n)?a=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,a=r[n]()),l.isValidTextValue(a)?a:""}))};var L={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return z.apply(L,arguments)};var P={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return z.apply(P,arguments)};var I=/^[:|\|]/;function z(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,c){var u,h,f,p;for(f=3;f=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(a=10*a+s-48),!l||!c){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var O=2e9;l.seedPseudoRandom=function(){O=2e9},l.pseudoRandom=function(){var t=O;return O=(69069*O+1)%4294967296,Math.abs(O-t)<429496729?l.pseudoRandom():O/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+s))+")"+(c<1?"scale("+c+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":711,"./anchor_utils":716,"./angles":717,"./array":718,"./clean_number":719,"./clear_responsive":721,"./coerce":722,"./dates":723,"./dom":724,"./extend":726,"./filter_unique":727,"./filter_visible":728,"./geometry2d":731,"./identity":734,"./is_plain_object":736,"./keyed_container":737,"./localize":738,"./loggers":739,"./make_trace_groups":740,"./matrix":741,"./mod":742,"./nested_property":743,"./noop":744,"./notifier":745,"./push_unique":749,"./regex":751,"./relative_attr":752,"./relink_private":753,"./search":754,"./stats":757,"./throttle":760,"./to_log_range":761,d3:165,"fast-isnumeric":237}],736:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],737:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":771,"./notifier":745}],740:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:165}],741:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],743:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;li||c===a||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===a||li||c===a||cs)return!1;var u,h,f,p,d,g=r.length,m=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,m)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":711,"./matrix":741}],748:[function(t,e,r){(function(r){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":756,regl:499}],749:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,h=0,f=e.length,p=0,d=f>1?(e[f-1]-e[0])/(f-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);h90&&a.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(i=Math.min(i,h),l.push(u),a=u)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":718,"fast-isnumeric":237}],758:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":122}],759:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var M=t.text(),E=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),E?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(E[2],i,(function(n,a,i){C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void e();var l=C.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:L,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var h=s(u,"width"),f=s(u,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===L[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-h/2,d-f/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?o.attr({x:t.attr("x"),y:d-f/2}):"a"===L[0]&&0!==L.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:p,y:+t.attr("y")+d-f/2}),A&&A.call(t,l),e(l)}))}))):P(),t}function P(){C.empty()||(L=t.attr("class")+"-math",C.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}y.test(e)?u():(r=t,l=[{node:t}]);for(var C=e.split(m),L=0;L|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,c=0;ca?o.push(u.substr(0,d-a)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function E(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="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:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],761:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":237}],762:[function(t,e,r){"use strict";var n=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,i=t("topojson-client").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=a[t.locationmode],n=e.objects[r];return i(e,n).features}},{"../plots/geo/constants":813,"topojson-client":538}],763:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],764:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],765:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,f=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!g&&(f(m,v),p(t),!0)}var x,b,_,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),C=E||[],L=u(v,h).get(),P=[],I=-1,z=C.length;for(x=0;xC.length-(A?0:1))i.warn("index out of range",h,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?P.push(_):A?("add"===k&&(k={}),C.splice(_,0,k),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)C.splice(P[x],1),L&&L.splice(P[x],1);if(C.length?E||e.set(C):e.set(null),g)return!1;if(f(m,v),d!==a){var O;if(-1===I)O=S;else{for(z=Math.max(C.length,z),O=[],x=0;x=I);x++)O.push(_);for(x=I;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(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]),z(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,c,u,h,f=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=X(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[f.previousPromises];i.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(H(t,i,a)||f.supplyDefaults(t),i.legend&&s.push(k.doLegend),i.layoutstyle&&s.push(k.layoutStyles),i.axrange&&G(s,a.rangesAltered),i.ticks&&s.push(k.doTicksRelayout),i.modebar&&s.push(k.doModeBar),i.camera&&s.push(k.doCamera),i.colorbars&&s.push(k.doColorBars),s.push(E)),s.push(f.rehover,f.redrag),c.add(t,q,[t,a.undoit],q,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==i){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(t,e){var r,n,a,i=t.layout,l=t._fullLayout,c=l._guiEditing,f=N(l._preGUI,c),p=Object.keys(e),g=d.list(t),m=o.extendDeepAll({},e),v={};for(U(e),p=Object.keys(e),n=0;n0&&"string"!=typeof z.parts[D];)D--;var R=z.parts[D],F=z.parts[D-1]+"."+R,j=z.parts.slice(0,D).join("."),V=s(t.layout,j).get(),q=s(l,j).get(),H=z.get();if(void 0!==O){k[I]=O,S[I]="reverse"===R?O:B(H);var G=h.getLayoutValObject(l,z.parts);if(G&&G.impliedEdits&&null!==O)for(var X in G.impliedEdits)E(o.relativeAttr(I,X),G.impliedEdits[X]);if(-1!==["width","height"].indexOf(I))if(O){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",O?null:l.width),E("height",O?null:l.height);else if(F.match(Y))P(F),s(l,j+"._inputRange").set(null);else if(F.match(W)){P(F),s(l,j+"._inputRange").set(null);var Q=s(l,j).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(Z)&&s(l,j+"._inputDomain").set(null);if("type"===R){var $=V,tt="linear"===q.type&&"log"===O,et="log"===q.type&&"linear"===O;if(tt||et){if($&&$.range)if(q.autorange)tt&&($.range=$.range[1]>$.range[0]?[1,2]:[2,1]);else{var rt=$.range[0],nt=$.range[1];tt?(rt<=0&&nt<=0&&E(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),E(j+".range[0]",Math.log(rt)/Math.LN10),E(j+".range[1]",Math.log(nt)/Math.LN10)):(E(j+".range[0]",Math.pow(10,rt)),E(j+".range[1]",Math.pow(10,nt)))}else E(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete l[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,O,E),u.getComponentMethod("images","convertCoords")(t,q,O,E)}else E(j+".autorange",!0),E(j+".range",null);s(l,j+"._inputRange").set(null)}else if(R.match(M)){var at=s(l,I).get(),it=(O||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,E),u.getComponentMethod("images","convertCoords")(t,at,it,E)}var ot=w.containerArrayMatch(I);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(O)?S[I]=null:w.isRemoveVal(O)?S[I]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(_,lt),v[r]||(v[r]={});var ct=v[r][n];ct||(ct=v[r][n]={}),ct[st]=O,delete e[I]}else"reverse"===R?(V.range?V.range.reverse():(E(j+".autorange",!0),V.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==H&&"select"!==H||l._has("gl2d")?_.plot=!0:G?A.update(_,G):_.calc=!0,z.set(O))}}for(r in v){w.applyContainerArrayChanges(t,f(i,r),v[r],_,f)||(_.plot=!0)}var ut=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function h(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&h()};e()}var d,g,m=0;function v(t){return Array.isArray(a)?m>=a.length?t.transitionOpts=a[m]:t.transitionOpts=a[0]:t.transitionOpts=a,m++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,m=(u[g]||d[g]||{}).name,v=e[n].name,y=u[m]||d[m];m&&v&&"number"==typeof v&&y&&S<5&&(S++,o.warn('addFrames: overwriting frame "'+(u[m]||d[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[g]={name:g},p.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=f.modifyFrames,u=f.modifyFrames,h=[t,s],p=[t,i];return c&&c.add(t,l,h,u,p),f.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],u=r.deleteTraces,h=t,f=[e,l],p=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=u[o];else{var h=t._module;if(h||(h=(n.modules[t.type||i.type.dflt]||{})._module),!h)return!1;if(!(a=(r=h.attributes)&&r[o])){var f=h.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return b(a,e,s)},r.getLayoutValObject=function(t,e){return b(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function h(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:h,applyUpdate:function(e,r){e&&u(e,r);var a=h();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":735,"../plots/attributes":780}],774:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),h=t("../components/modebar"),f=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),g=d.enforce,m=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function x(t){var e,a,s,u,d,g,m=t._fullLayout,v=m._size,x=v.p,_=f.list(t,"",!0);if(m._paperdiv.style({width:t._context.responsive&&m.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":m.width+"px",height:t._context.responsive&&m.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),t._context.setBackground(t,m.paper_bgcolor),r.drawMainTitle(t),h.manage(t),!m._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var A=[],M=[],S=[],E=1===l.opacity(m.paper_bgcolor)&&1===l.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(a in m._plots)if((s=m._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,L=s.yaxis.domain,P=s.plotgroup;if(y(C,L,S)){var I=P.node(),z=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(z.node(),I.childNodes[0]),M.push(a)}else P.select("rect.bg").remove(),S.push([C,L]),E||(A.push(a),M.push(a))}var O,D,R,F,B,N,j,V,U,q,H,G,Y,W=m._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){m._plots[t].bg=n.select(this)})),e=0;eT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&m(i)&&t(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":735,"../plots/attributes":780,"../plots/plots":846,"./plot_config":771,"./plot_schema":772,"./plot_template":773}],776:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,h={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,f,p,d;function g(t){return!(t in e)||o.validate(e[t],h[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),f=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var m={};function v(t,r){return o.coerce(e,m,h,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},f);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),b?A.height=b:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,h=k._fullLayout.height;function f(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),t(T?p:s.encodeJSON(p))}if(f(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:h,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,A,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":735,"../plots/plots":846,"../snapshot/helpers":870,"../snapshot/svgtoimg":872,"../snapshot/tosvg":874,"../version":1322,"./plot_api":770,"fast-isnumeric":237}],777:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var h=Object.keys(t),f=0;fx.length&&a.push(d("unused",i,v.concat(x.length)));var A,M,S,E,C,L=x.length,P=Array.isArray(k);if(P&&(L=Math.min(L,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&a.push(d("unused",i,v.concat(M,x[M].length)));var I=x[M].length;for(A=0;A<(P?Math.min(I,k[M].length):I);A++)S=P?k[M][A]:k,E=y[M][A],C=x[M][A],n.validate(E,S)?C!==E&&C!==+E&&a.push(d("dynamic",i,v.concat(M,A),E,C)):a.push(d("value",i,v.concat(M,A),E))}else a.push(d("array",i,v.concat(M),y[M]));else for(M=0;M1&&p.push(d("object","layout"))),a.supplyDefaults(g);for(var m=g._fullData,v=r.length,y=0;y0&&((b=A-o(m)-o(v))>M?_/b>E&&(y=m,x=v,E=_/b):_/A>E&&(y={val:m.val,pad:0},x={val:v.val,pad:0},E=_/A));if(f===p){var C=f-1,L=f+1;if(T)if(0===f)i=[0,1];else{var P=(f>0?h:u).reduce((function(t,e){return Math.max(t,o(e))}),0),I=f/(1-Math.min(.5,P/A));i=f>0?[0,I]:[I,0]}else i=k?[Math.max(0,C),Math.max(1,L)]:[C,L]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),E=(x.val-y.val-S(m.val,v.val))/(A-o(y)-o(x)),i=[y.val-E*o(y),x.val+E*o(x)];return d&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function c(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],c=[];function f(t,e){for(r=0;r=r&&(c.extrapad||!o)){s=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function p(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,s,l,c,f,d,g,m,v=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(g=1/0,m=-1/0,w)for(a=0;a0&&(g=o),o>m&&o-i&&(g=o),o>m&&o=I;a--)P(a);return{min:v,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":711,"../../lib":735,"../../registry":866,"fast-isnumeric":237}],783:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),p=t("./clean_ticks"),d=t("../../constants/numerical"),g=d.ONEAVGYEAR,m=d.ONEAVGMONTH,v=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=d.MINUS_SIGN,w=d.BADNUM,T=t("../../constants/alignment"),k=T.MID_SHIFT,A=T.CAP_SHIFT,M=T.LINE_SPACING,S=T.OPPOSITE_SIDE,E=e.exports={};E.setConvert=t("./set_convert");var C=t("./axis_autotype"),L=t("./axis_ids");E.id2name=L.id2name,E.name2id=L.name2id,E.cleanId=L.cleanId,E.list=L.list,E.listIds=L.listIds,E.getFromId=L.getFromId,E.getFromTrace=L.getFromTrace;var P=t("./autorange");E.getAutoRange=P.getAutoRange,E.findExtremes=P.findExtremes;function I(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}E.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=l[0]||i),i||(i=a),u[c]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,u,c)},E.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var c=E.getFromId(e,n);l=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(l)},E.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:E.getFromId(e,r).cleanPos)(t)},E.redrawComponents=function(t,e){e=e||E.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.saveRangeInitial=function(t,e){for(var r=E.list(t,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=E.tickIncrement(t,"M6","reverse")+1.5*v:i.exactMonths>.8?t=E.tickIncrement(t,"M1","reverse")+15.5*v:t-=v/2;var l=E.tickIncrement(t,r);if(l<=n)return l}return t}(x,t,y,c,i)),m=x,0;m<=u;)m=E.tickIncrement(m,y,!1,i);return{start:e.c2r(x,0,i),end:e.c2r(m,0,i),size:y,_dataSpan:u-c}},E.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/a,E.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),H(t)},E.calcTicks=function(t,e){E.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=I(s.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var c="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var u=0;ui&&h=o:n<=o)&&!(c.length>r||n===e);n=E.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),t.rangebreaks){var h=c.length;if(h){var f=0;"auto"===t.tickmode&&(f=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var p,d=[],g=l?1:-1,m=l?h-1:0,v=l?0:h-1;g*v<=g*m;v+=g){var y=c[v];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var x=t.c2p(y.value);x===p?d[d.length-1].valuef)&&(p=x,d.push(y))}}c=d.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&c.pop(),t._tmax=(c[c.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=v&&i<=10||e>=15*v)t._tickround="d";else if(e>=x&&i<=16||e>=y)t._tickround="M";else if(e>=b&&i<=19||e>=x)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(c)>3&&(W(t.exponentformat)&&!Z(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}E.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*q(e,r,R)):i>m?(e/=m,t.dtick="M"+q(e,1,F)):i>v?(t.dtick=q(e,v,t._hasDayOfWeekBreaks?[1,2,7,14]:N),t.tick0=s.dateTick0(t.calendar,!0)):i>y?t.dtick=q(e,y,F):i>x?t.dtick=q(e,x,B):i>b?t.dtick=q(e,b,B):(r=n(10),t.dtick=q(e,r,R))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+q(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=q(e,r,U)):(t.tick0=0,r=n(10),t.dtick=q(e,r,R));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},E.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,i);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?V:j,h=t+.01*o,f=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},E.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1]"+l,t._prevDateHead=l));e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=X(Math.pow(10,l),t,i,n);else if(a(o)||"D"===u&&s.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;"power"===p||W(p)&&Z(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":_)+f+"",e.fontSize*=1.25):("e"===p||"E"===p)&&f>2?e.text="1"+p+(h>0?"+":_)+f:(e.text=X(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=X(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=X(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=X(e.x,t,a,n)}(t,o,0,c,g),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var m=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[m(o.x-.5),m(o.x+t.dtick-.5)]}return o},E.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return E.hoverLabelText(t,e)+" - "+E.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=E.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var Y=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Z(t){return t>14||t<-15}function X(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=E.getTickFormat(e),h=e.separatethousands;if(n){var f={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};H(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":W(l)&&(t+=Y[c/3+5]));return i?_+t:t}function J(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-u:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),p.reverse()),r.width>0){var m=r.right-(e._offset+e._length);m>0&&(n.xr=1,n.r=m);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?u-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-u:0,h),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==f._dfltTitle[d]&&(n[l]+=Q(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}Z&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,et(e),n),i.autoMargin(t,rt(e),a),i.autoMargin(t,nt(e),s)})),r.skipTitle||Z&&"bottom"===e.side||Y.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+Q(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,u,f,p=E.getPxPosition(t,e);"x"===i?(l=e._offset+e._length/2,u="top"===e.side?p-r:p+r):(u=e._offset+e._length/2,l="right"===e.side?p+r:p-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(f={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var g=h.getTranslate(d.node().parentNode);f.offsetLeft=g.x,f.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(f.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:f,transform:s,attributes:{x:l,y:u,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Y)}}function X(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=tt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},E.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},E.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},E.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},E.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var c=s.deg2rad(r);o=t.ticklen*Math.cos(c)+1,l=t.ticklen*Math.sin(c)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var u,h,f,p,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(p="bottom"===t.side?1:-1,u=l*p,h=e+o*p,f="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+u},d.yFn=function(t){return t.dy+h+t.fontSize*f},d.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*p<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(p="right"===t.side?1:-1,u=o,h=-l*p,f=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(u+t.fontSize*f)*p},d.yFn=function(t){return t.dy+h+t.fontSize*k},d.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},E.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],K);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},E.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&E.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=y(o[l])){u=d;break}var h=a("pattern",u);if(h===d)for(l=0;l<2;l++)(c=y(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*x)||T)for(r=0;rz&&RP&&(P=R);p/=(P-L)/(2*I),L=c.l2r(L),P=c.l2r(P),c.range=c._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function F(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function N(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,a,i)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(t){L&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),L=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function H(t,e,r,n){for(var a,i,o,l,c=!1,u={},h={},f=0;f=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(V(a),2!==t||dt||Vt(),pt)i.indexOf("select")>-1&&A(r,a,X,J,e.id,Et),i.indexOf("event")>-1&&h.click(a,r,e.id);else if(1===t&&dt){var s=g?j:P,c="s"===g||"w"===L?0:1,u=s._name+".range["+c+"]",f=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,c),p="left",d="middle";if(s.fixedrange)return;g?(d="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===L&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(vt).call(l.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:d}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",a,u,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+yt)),a=Math.max(0,Math.min(tt,r+xt)),i=Math.abs(n-yt),o=Math.abs(a-xt);function s(){kt="",bt.r=bt.l,bt.t=bt.b,Mt.attr("d","M0,0Z")}if(bt.l=Math.min(yt,n),bt.r=Math.max(yt,n),bt.t=Math.min(xt,a),bt.b=Math.max(xt,a),et.isSubplotConstrained)i>C||o>C?(kt="xy",i/$>o/tt?(o=i*tt/$,xt>a?bt.t=xt-o:bt.b=xt+o):(i=o*$/tt,yt>n?bt.l=yt-i:bt.r=yt+i),Mt.attr("d",q(bt))):s();else if(rt.isSubplotConstrained)if(i>C||o>C){kt="xy";var l=Math.min(bt.l/$,(tt-bt.b)/tt),c=Math.max(bt.r/$,(tt-bt.t)/tt);bt.l=l*$,bt.r=c*$,bt.b=(1-l)*tt,bt.t=(1-c)*tt,Mt.attr("d",q(bt))}else s();else!at||og[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":735,"fast-isnumeric":237}],801:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":704}],802:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),m=t("../../components/shapes/draw_newshape/helpers").handleEllipse,v=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=x.filter,S=x.tester,E=t("./handle_outline").clearSelect,C=t("./helpers"),L=C.p2r,P=C.axValue,I=C.getTransform;function z(t,e,r,n,a,i,o){var s,l,c,u,h,f,d,m,v,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(f=j(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),f(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=v(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function V(t,e,r){var n,i,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!j){var r=Z.clickmode;b.done(ft).then((function(){if(b.clear(ft),2===t){for(lt.remove(),w=0;w-1&&z(e,W,a.xaxes,a.yaxes,a.subplot,a,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},a.doneFn=function(){ht.remove(),b.done(ft).then((function(){b.clear(ft),a.gd.emit("plotly_selected",E),_&&a.selectionDefs&&(_.subtract=st,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pt)})).catch(y.error),j&&B(a)}},clearSelect:E,clearSelectionsCache:B,selectOnClick:z}},{"../../components/color":602,"../../components/dragelement/helpers":620,"../../components/drawing":624,"../../components/fx":642,"../../components/fx/helpers":638,"../../components/shapes/draw_newshape/display_outlines":687,"../../components/shapes/draw_newshape/helpers":688,"../../components/shapes/draw_newshape/newshapes":689,"../../lib":735,"../../lib/clear_gl_canvases":720,"../../lib/polygon":747,"../../lib/throttle":760,"../../plot_api/subroutines":774,"../../registry":866,"./axis_ids":786,"./constants":789,"./handle_outline":793,"./helpers":794,polybooljs:478}],803:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,h=t("../../constants/numerical"),f=h.FP_SAFE,p=h.BADNUM,d=h.LOG_CLIP,g=h.ONEDAY,m=h.ONEHOUR,v=h.ONEMIN,y=h.ONESEC,x=t("./axis_ids"),b=t("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function A(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*d*Math.abs(n-a))}return p}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===p){if(!a(e))return p;if(e=+e,(o||{}).msUTC)return e;var c=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-c/10);s=l(new Date(u))+c/10}return s}function S(e,r,n){return s(e,r,n||t.calendar)}function E(e){return t._categories[Math.round(e)]}function C(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function L(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=L(t);return void 0!==e?e:a(t)?+t:void 0}function I(t,e,r){return n.round(r+e*t,2)}function z(t,e,r){return(t-r)/e}var O=function(e){return a(e)?I(e,t._m,t._b):p},D=function(e){return z(e,t._m,t._b)};if(t.rangebreaks){var R="y"===h;O=function(e){if(!a(e))return p;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=R;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,s=0,l=0;lu)){s=o<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?I(e,t._m2,h):0},D=function(e){var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return z(e,t._m2,t._B[n])}}t.c2l="log"===t.type?A:c,t.l2c="log"===t.type?T:c,t.l2p=O,t.p2l=D,t.c2p="log"===t.type?function(t,e){return O(A(t,e))}:O,t.p2c="log"===t.type?function(t){return T(D(t))}:D,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=D,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return A(o(t),e)},t.r2d=t.r2c=function(t){return T(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=A,t.l2d=T,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return T(D(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=D,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=S,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return S(D(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=C,t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(D(t))},t.r2p=t.d2p,t.p2r=D,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=L,t.l2r=t.c2r=c,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(D(t))},t.r2p=t.d2p,t.p2r=D,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;af&&(s[n]=f),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=x.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,c=t.r2l(t[i][0],o),u=t.r2l(t[i][1],o),f="y"===h;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(p=!p),p&&t._rangebreaks.reverse();var d=p?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;sa&&(a+=7,sa&&(a+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function m(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,c=a._length,u=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),m=d[1]-d[0],v=g[1]-g[0];p[0]=(d[0]*(1-r)+r*g[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/m),a.range[0]=a.l2r(d[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(f){var y=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=a._offset-M,C=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":624,"../../lib":735,"../../registry":866,"./axes":783,d3:165}],808:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",h=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(o(c,l)){var p=i(c),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){i(t,c,s.cache),s.check=function(){if(l){var e=i(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h0&&a<0&&(a+=360);var s=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[a,o],[a,i],[a-s,i],[a-2*s,i],[a-3*s,i],[n,i]]]}}e.exports=function(t){return new _(t)},w.plot=function(t,e,r){var n=this,a=e[this.id],i=[],o=!1;for(var s in v.layerNameToAdjective)if("frame"!==s&&a["show"+s]){o=!0;break}for(var l=0;l0&&i._module.calcGeoJSON(a,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),c.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},w.updateProjection=function(t,e){var r=this.graphDiv,o=e[this.id],s=e._size,l=o.domain,c=o.projection,u=o.lonaxis,f=o.lataxis,p=u._ax,d=f._ax,g=this.projection=function(t){for(var e=t.projection.type,r=n.geo[v.projNames[e]](),a=t._isClipped?v.lonaxisSpan[e]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(t){return t?r:[]},s=0;sa*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(a-s*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*s).translate([l,c])},r.precision(v.precision),a&&r.clipAngle(a-v.clipPad);return r}(o),m=[[s.l+s.w*l.x[0],s.t+s.h*(1-l.y[1])],[s.l+s.w*l.x[1],s.t+s.h*(1-l.y[0])]],y=o.center||{},x=c.rotation||{},b=u.range||[],_=f.range||[];if(o.fitbounds){p._length=m[1][0]-m[0][0],d._length=m[1][1]-m[0][1],p.range=h(r,p),d.range=h(r,d);var w=(p.range[0]+p.range[1])/2,k=(d.range[0]+d.range[1])/2;if(o._isScoped)y={lon:w,lat:k};else if(o._isClipped){y={lon:w,lat:k},x={lon:w,lat:k,roll:x.roll};var A=c.type,M=v.lonaxisSpan[A]/2||180,S=v.lataxisSpan[A]/2||180;b=[w-M,w+M],_=[k-S,k+S]}else y={lon:w,lat:k},x={lon:w,lat:x.lat,roll:x.roll}}g.center([y.lon-x.lon,y.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(c.parallels);var E=T(b,_);g.fitExtent(m,E);var C=this.bounds=g.getBounds(E),L=this.fitScale=g.scale(),P=g.translate();if(!isFinite(C[0][0])||!isFinite(C[0][1])||!isFinite(C[1][0])||!isFinite(C[1][1])||isNaN(P[0])||isNaN(P[0])){for(var I=["fitbounds","projection.rotation","center","lonaxis.range","lataxis.range"],z="Invalid geo settings, relayout'ing to default view.",O={},D=0;D-1&&g(n.event,i,[r.xaxis],[r.yaxis],r.id,h),c.indexOf("event")>-1&&l.click(i,n.event))}))}function v(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},w.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,a="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",a),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(s.setClipUrl,a,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(t.mockAxis,r)},w.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,a=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},i.extendFlat(this.viewInitial,e)},w.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",a).attr("transform",n)}},{"../../components/color":602,"../../components/dragelement":621,"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/geo_location_utils":729,"../../lib/topojson_utils":762,"../../registry":866,"../cartesian/autorange":782,"../cartesian/axes":783,"../cartesian/select":802,"../plots":846,"./constants":813,"./projections":818,"./zoom":819,d3:165,"topojson-client":538}],815:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex,i=t("./geo"),o="geo",s=a(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,a=e._subplots.geo,s=0;s0&&L<0&&(L+=360);var P,I,z,O=(C+L)/2;if(!p){var D=d?h.projRotate:[O,0,0];P=r("projection.rotation.lon",D[0]),r("projection.rotation.lat",D[1]),r("projection.rotation.roll",D[2]),r("showcoastlines",!d&&y)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!y&&void 0)&&r("oceancolor")}(p?(I=-96.6,z=38.7):(I=d?O:P,z=(E[0]+E[1])/2),r("center.lon",I),r("center.lat",z),g)&&r("projection.parallels",h.projParallels||[0,60]);r("projection.scale"),r("showland",!!y&&void 0)&&r("landcolor"),r("showlakes",!!y&&void 0)&&r("lakecolor"),r("showrivers",!!y&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&y)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",y),r("subunitcolor"),r("subunitwidth")),d||r("showframe",y)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):m?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){a(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":735,"../get_data":820,"../subplot_defaults":860,"./constants":813,"./layout_attributes":816}],818:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map((function(t){return r(t,n)}))};if(!c.hasOwnProperty(e.type))return null;var a=c[e.type];return t.geo.stream(e,n(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,a)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map((function(t){return e(t,r)}))}}},a=[],i=[],o={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},s={lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var t=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],t}},l={polygonStart:u,lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var t=[],e=[];return i.forEach((function(r){!function(t){if((e=t.length)<4)return!1;var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];for(;++rn^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(t[0],r))return t.push(e),!0}))||t.push([e])})),i=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function u(){}var h=1e-6,f=Math.PI,p=f/2,d=(Math.sqrt(f),f/180),g=180/f;function m(t){return t>1?p:t<-1?-p:Math.asin(t)}function v(t){return t>1?0:t<-1?f:Math.acos(t)}var y=t.geo.projection,x=t.geo.projectionMutator;function b(t,e){var r=(2+p)*Math.sin(e);e/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>h;n++){var i=Math.cos(e);e-=a=(e+Math.sin(e)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(f*(4+f))*t*(1+Math.cos(e)),2*Math.sqrt(f/(4+f))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-f,0],[0,p],[f,0]]],[[[-f,0],[0,-p],[f,0]]]];function a(t,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],l}function i(){r=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))}))}e.invert&&(a.invert=function(t,i){for(var o=r[+(i<0)],s=n[+(i<0)],l=0,u=o.length;l=0;--a){var p;o=180*(p=n[1][a])[0][0]/f,s=180*p[0][1]/f,c=180*p[1][1]/f,u=180*p[2][0]/f,h=180*p[2][1]/f;r.push(l([[u-e,h-e],[u-e,c+e],[o+e,c+e],[o+e,s-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),i)},a},o.lobes=function(t){return arguments.length?(n=t.map((function(t){return t.map((function(t){return[[t[0][0]*f/180,t[0][1]*f/180],[t[1][0]*f/180,t[1][1]*f/180],[t[2][0]*f/180,t[2][1]*f/180]]}))})),i(),o):n.map((function(t){return t.map((function(t){return[[180*t[0][0]/f,180*t[0][1]/f],[180*t[1][0]/f,180*t[1][1]/f],[180*t[2][0]/f,180*t[2][1]/f]]}))}))},o},b.invert=function(t,e){var r=.5*e*Math.sqrt((4+f)/f),n=m(r),a=Math.cos(n);return[t/(2/Math.sqrt(f*(4+f))*(1+a)),m((n+r*(a+2))/(2+p))]},(t.geo.eckert4=function(){return y(b)}).raw=b;var _=t.geo.azimuthalEqualArea.raw;function w(t,e){if(arguments.length<2&&(e=t),1===e)return _;if(e===1/0)return T;function r(r,n){var a=_(r/e,n);return a[0]*=t,a}return r.invert=function(r,n){var a=_.invert(r/t,n);return a[0]*=e,a},r}function T(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function k(t,e){return[3*t/(2*f)*Math.sqrt(f*f/3-e*e),e]}function A(t,e){return[t,1.25*Math.log(Math.tan(f/4+.4*e))]}function M(t){return function(e){var r,n=t*Math.sin(e),a=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>h&&--a>0);return e/2}}T.invert=function(t,e){var r=2*m(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=x(w),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=w,k.invert=function(t,e){return[2/3*f*t/Math.sqrt(f*f/3-e*e),e]},(t.geo.kavrayskiy7=function(){return y(k)}).raw=k,A.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*f]},(t.geo.miller=function(){return y(A)}).raw=A,M(f);var S=function(t,e,r){var n=M(r);function a(r,a){return[t*r*Math.cos(a=n(a)),e*Math.sin(a)]}return a.invert=function(n,a){var i=m(a/e);return[n/(t*Math.cos(i)),m((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/p,Math.SQRT2,f);function E(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return y(S)}).raw=S,E.invert=function(t,e){var r,n=e,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-e)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>h&&--a>0);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return y(E)}).raw=E;var C=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function L(t,e){var r,n=Math.min(18,36*Math.abs(e)/f),a=Math.floor(n),i=n-a,o=(r=C[a])[0],s=r[1],l=(r=C[++a])[0],c=r[1],u=(r=C[Math.min(19,++a)])[0],h=r[1];return[t*(l+i*(u-o)/2+i*i*(u-2*l+o)/2),(e>0?p:-p)*(c+i*(h-s)/2+i*i*(h-2*c+s)/2)]}function P(t,e){return[t*Math.cos(e),e]}function I(t,e){var r,n=Math.cos(e),a=(r=v(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*a,Math.sin(e)*a]}function z(t,e){var r=I(t,e);return[(r[0]+t/p)/2,(r[1]+e)/2]}C.forEach((function(t){t[1]*=1.0144})),L.invert=function(t,e){var r=e/p,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=C[i][1],s=C[i+1][1],l=C[Math.min(19,i+2)][1],c=l-o,u=l-2*s+o,h=2*(Math.abs(r)-s)/c,f=u/c,m=h*(1-f*h*(1-2*f*h));if(m>=0||1===i){n=(e>=0?5:-5)*(m+a);var v,y=50;do{m=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=C[i][1],s=C[i+1][1],l=C[Math.min(19,i+2)][1],n-=(v=(e>=0?p:-p)*(s+m*(l-o)/2+m*m*(l-2*s+o)/2)-e)*g}while(Math.abs(v)>1e-12&&--y>0);break}}while(--i>=0);var x=C[i][0],b=C[i+1][0],_=C[Math.min(19,i+2)][0];return[t/(b+m*(_-x)/2+m*m*(_-2*b+x)/2),n*d]},(t.geo.robinson=function(){return y(L)}).raw=L,P.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return y(P)}).raw=P,I.invert=function(t,e){if(!(t*t+4*e*e>f*f+h)){var r=t,n=e,a=25;do{var i,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),p=Math.sin(2*n),d=c*c,g=u*u,m=s*s,y=1-g*l*l,x=y?v(u*l)*Math.sqrt(i=1/y):i=0,b=2*x*u*s-t,_=x*c-e,w=i*(g*m+x*u*l*d),T=i*(.5*o*p-2*x*c*s),k=.25*i*(p*s-x*c*g*o),A=i*(d*l+x*m*u),M=T*k-A*w;if(!M)break;var S=(_*T-b*A)/M,E=(b*k-_*w)/M;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--a>0);return[r,n]}},(t.geo.aitoff=function(){return y(I)}).raw=I,z.invert=function(t,e){var r=t,n=e,a=25;do{var i,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),c=s*s,u=o*o,f=Math.sin(r),d=Math.cos(r/2),g=Math.sin(r/2),m=g*g,y=1-u*d*d,x=y?v(o*d)*Math.sqrt(i=1/y):i=0,b=.5*(2*x*o*g+r/p)-t,_=.5*(x*s+n)-e,w=.5*i*(u*m+x*o*d*c)+.5/p,T=i*(f*l/4-x*s*g),k=.125*i*(l*g-x*s*u*f),A=.5*i*(c*d+x*m*o)+.5,M=T*k-A*w,S=(_*T-b*A)/M,E=(b*k-_*w)/M;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--a>0);return[r,n]},(t.geo.winkel3=function(){return y(z)}).raw=z}},{}],819:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function h(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],h={},f={};function p(t,e){h[n+"."+t]=a.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=a.nestedProperty(u,t);r.get()!==e&&(r.set(e),a.nestedProperty(l,t).set(e),f[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function f(t,e){var r=u(0,e);function a(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),h(t,e,a)})),r}function p(t,e){var r,a,i,o,s,f,p,d,g,m=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),a=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return m.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=e.rotate(),i=e.translate(),o=a,s=v(r)})).on("zoom",(function(){if(f=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return m.scale(e.scale()),void m.translate(e.translate());e.scale(n.event.scale),e.translate([i[0],n.event.translate[1]]),s?v(f)&&(d=v(f),p=[o[0]+(d[0]-s[0]),a[1],a[2]],e.rotate(p),o=p):s=v(r=f),g=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&h(t,e,y)})),m}function d(t,e){var r,a={r:e.rotate(),k:e.scale()},i=u(0,e),o=function(t){var e=0,r=arguments.length,a=[];for(;++ed?(i=(h>0?90:-90)-p,a=0):(i=Math.asin(h/d)*s-p,a=Math.sqrt(d*d-h*h));var g=180-i-2*p,m=(Math.atan2(f,u)-Math.atan2(c,a))*s,v=(Math.atan2(f,u)-Math.atan2(c,-a))*s;return b(r[0],r[1],i,m)<=b(r[0],r[1],g,v)?[i,m,r[2]]:[g,v,r[2]]}function b(t,e,r,n){var a=_(r-t),i=_(n-e);return Math.sqrt(a*a+i*i)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,a=t.slice(),i=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return a[i]=t[i]*l-t[s]*c,a[s]=t[s]*l+t[i]*c,a}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,a=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(i=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],i||s?(i&&(m(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(m(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=a),Math.abs(c.dragStart[0]-n).999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":602,"../../../lib":735,"../../../registry":866,"../../get_data":820,"../../subplot_defaults":860,"./axis_defaults":828,"./layout_attributes":831}],831:[function(t,e,r){"use strict";var n=t("./axis_attributes"),a=t("../../domain").attributes,i=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":735,"../../../lib/extend":726,"../../domain":810,"./axis_attributes":827}],832:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}},{"../../../lib/str2rgbarray":758}],833:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var f=u.nticks||a.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/f)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=h}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],a=new Array(n.length),i=0;ir.deltaY?1.1:1/1.1,i=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*i.x,y:n*i.y,z:n*i.z})}a(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,a=e.container.getBoundingClientRect(),i=a.width,o=a.height;n.setAttributeNS(null,"viewBox","0 0 "+i+" "+o),n.setAttributeNS(null,"width",i),n.setAttributeNS(null,"height",o),x(e),e.glplot.axes.update(e.axesOptions);for(var s,l=Object.keys(e.traces),c=null,u=e.glplot.selection,d=0;d")):"isosurface"===t.type||"volume"===t.type?(w.valueLabel=f.tickText(e._mockAxis,e._mockAxis.d2l(u.traceCoordinate[3]),"hover").text,M.push("value: "+w.valueLabel),u.textLabel&&M.push(u.textLabel),y=M.join("
")):y=u.textLabel;var S={x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:_};p.appendArrayPointValue(S,b,_),t._module.eventData&&(S=b._module.eventData(S,u,b,{},_));var E={points:[S]};e.fullSceneLayout.hovermode&&p.loneHover({trace:b,x:(.5+.5*v[0]/v[3])*i,y:(.5-.5*v[1]/v[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:y,name:c.name,color:p.castHoverOption(b,_,"bgcolor")||c.color,borderColor:p.castHoverOption(b,_,"bordercolor"),fontFamily:p.castHoverOption(b,_,"font.family"),fontSize:p.castHoverOption(b,_,"font.size"),fontColor:p.castHoverOption(b,_,"font.color"),nameLength:p.castHoverOption(b,_,"namelength"),textAlign:p.castHoverOption(b,_,"align"),hovertemplate:h.castOption(b,_,"hovertemplate"),hovertemplateLabels:h.extendFlat({},S,w),eventData:[S]},{container:n,gd:r}),u.buttons&&u.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),s=E}else p.loneUnhover(n),r.emit("plotly_unhover",s);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function k(t,e,r){for(var n=t.fullSceneLayout,a=0;a<3;a++){var i=T[a],o=i.charAt(0),s=n[i],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(h.isArrayOrTypedArray(l))for(var f,p=0;p<(u||l.length);p++)if(h.isArrayOrTypedArray(l[p]))for(var d=0;dm[1][i])m[0][i]=-1,m[1][i]=1;else{var C=m[1][i]-m[0][i];m[0][i]-=C/32,m[1][i]+=C/32}if("reversed"===s.autorange){var L=m[0][i];m[0][i]=m[1][i],m[1][i]=L}}else{var P=s.range;m[0][i]=s.r2l(P[0]),m[1][i]=s.r2l(P[1])}m[0][i]===m[1][i]&&(m[0][i]-=1,m[1][i]+=1),v[i]=m[1][i]-m[0][i],this.glplot.setBounds(i,{min:m[0][i]*f[i],max:m[1][i]*f[i]})}var I=c.aspectmode;if("cube"===I)g=[1,1,1];else if("manual"===I){var z=c.aspectratio;g=[z.x,z.y,z.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var O=[1,1,1];for(i=0;i<3;++i){var D=y[l=(s=c[T[i]]).type];O[i]=Math.pow(D.acc,1/D.count)/f[i]}g="data"===I||Math.max.apply(null,O)/Math.min.apply(null,O)<=4?O:[1,1,1]}c.aspectratio.x=u.aspectratio.x=g[0],c.aspectratio.y=u.aspectratio.y=g[1],c.aspectratio.z=u.aspectratio.z=g[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=h.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var a=["up","center","eye"],i=["x","y","z"];return e[a[r]]&&t[a[r]][i[n]]===e[a[r]][i[n]]}var a=!1;if(void 0===r)a=!0;else{for(var i=0;i<3;i++)for(var o=0;o<3;o++)if(!n(e,r,i,o)){a=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(a=!0)}return a},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=h.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),f=l||c;if(f){var p={};if(l&&(e=this.getCamera(),n=(r=h.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(a=this.glplot.getAspectratio(),o=(i=h.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),h.nestedProperty(s,this.id+".camera").set(e);if(c)i.set(a),h.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw()}return f},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",f={x:0,y:0,z:1},p={};p[c]=f;var d=n.layout;u.call("_storeDirectGUIEdit",d,a._preGUI,p),i.up=f,h.nestedProperty(d,c).set(f)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i),function(t,e,r){for(var n=0,a=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[i+l]=Math.min(s*t[i+l],255)}}(i,r,a);var o=document.createElement("canvas");o.width=r,o.height=a;var s,l=o.getContext("2d"),c=l.createImageData(r,a);switch(c.data.set(i),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];f.setConvert(e,this.fullLayout),e.setScale=h.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":642,"../../lib":735,"../../lib/show_no_webgl_msg":756,"../../lib/str2rgbarray":758,"../../plots/cartesian/axes":783,"../../registry":866,"./layout/convert":829,"./layout/spikes":832,"./layout/tick_marks":833,"./project":834,"gl-plot3d":300,"has-passive-events":414,"is-mobile":424,"webgl-context":565}],836:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var a=new Array(n),i=0;i\xa9 OpenStreetMap',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under CC BY SA.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},a=Object.keys(n);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:a,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",a.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],839:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(a){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(i){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":735}],840:[function(t,e,r){"use strict";var n=t("mapbox-gl"),a=t("../../lib"),i=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./mapbox"),h=r.constants=t("./constants");function f(t){return"string"==typeof t&&(-1!==h.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(h.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;lx/2){var b=g.split("|").join("
");v.text(b).attr("data-unformatted",b).call(c.convertToTspans,t),y=l.bBox(v.node())}v.attr("transform","translate(-3, "+(8-y.height)+")"),m.insert("rect",".static-attribution").attr({x:-y.width-6,y:-y.height-3,width:y.width+6,height:y.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;y.width+6>x&&(_=x/(y.width+6));var w=[n.l+n.w*u.x[1],n.t+n.h*(1-u.y[0])];m.attr("transform","translate("+w[0]+","+w[1]+") scale("+_+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates})},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.updateLayer=function(t){var e,r=this.subplot,n=u(t),a=this.subplot.belowLookup["layout-"+this.index];if("traces"===a)for(var i=r.getMapLayers(),s=0;s1)for(r=0;r-1&&v(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},_.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=h(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},_.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},_.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&z.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(h,s,u,a),y.cleanPlot(h,s,u,a);var B=!(!a._has||!a._has("gl2d")),N=!(!s._has||!s._has("gl2d")),j=!(!a._has||!a._has("cartesian"))||B,V=!(!s._has||!s._has("cartesian"))||N;j&&!V?a._bgLayer.remove():V&&!j&&(s._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&f({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||d)&&(d&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,c=i.componentsRegistry,u=e._basePlotModules,h=i.subplotsRegistry.cartesian;for(a in c)(s=c[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var f in u.length||u.push(h),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,h=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:f,size:r.b+o},t:{val:h,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),S(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,c=n.r,u=n.t,h=n.b,f=e.width,p=e.height,d=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in d)g[m]||delete d[m];for(var v in d.base={l:{val:0,size:s},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:h}},d){var x=d[v].l||{},b=d[v].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var A in d){if(a(w)&&d[A].r){var M=d[A].r.val,E=d[A].r.size;if(M>_){var C=(w*M+(E-f)*_)/(M-_),L=(E*(1-_)+(w-f)*(1-M))/(M-_);C>=0&&L>=0&&f-(C+L)>0&&C+L>s+c&&(s=C,c=L)}}if(a(k)&&d[A].t){var P=d[A].t.val,I=d[A].t.size;if(P>T){var z=(k*P+(I-p)*T)/(P-T),O=(I*(1-T)+(k-p)*(1-P))/(P-T);z>=0&&O>=0&&p-(O+z)>0&&z+O>h+u&&(h=z,u=O)}}}}}if(r.l=Math.round(s),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(h),r.p=Math.round(n.pad),r.w=Math.round(f)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var D=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var h={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};return e||(h.layout=u(s)),t.framework&&t.framework.isPolar&&(h=t.framework.getConfig()),c&&(h.frames=u(c)),i&&(h.config=u(t._context,!0)),"object"===n?h:JSON.stringify(h)},y.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,d[e]=i}}for(P(c,f,p),a=0;a1e-10?t:0}function f(t,e,r){e=e||0,r=r||0;for(var n=t.length,a=new Array(n),i=0;i0?r:1/0})),a=n.mod(r+1,e.length);return[e[r],e[a]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var a=-e*r,i=e*e+1,o=2*(e*a-r),s=a*a+r*r-t*t,l=Math.sqrt(o*o-4*i*s),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[[c,e*c+a+n],[u,e*u+a+n]]},clampTiny:h,pathPolygon:function(t,e,r,n,a,i){return"M"+f(u(t,e,r,n),a,i).join("L")},pathPolygonAnnulus:function(t,e,r,n,a,i,o){var s,l;t=0?f.angularAxis.domain:n.extent(T),E=Math.abs(T[1]-T[0]);A&&!k&&(E=0);var C=S.slice();M&&k&&(C[1]+=E);var L=f.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),f.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var P=f.angularAxis.ticksStep||(C[1]-C[0])/(L*(f.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var I=n.range.apply(this,C);if(I=I.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=M?E:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),O=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));t=n.select(O)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var D,R=t.select(".chart-group"),F={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+f.font.outlineColor})).join(",")};if(f.showLegend){D=t.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var N=p.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:p.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:D,elements:N,reverseOrder:f.legend.reverseOrder})})();var j=D.node().getBBox();x=Math.min(f.width-j.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),D.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else D=t.select(".legend-group").style({display:"none"});t.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(f.width-(f.margin.left+f.margin.right+2*x+(j?j.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),f.title&&f.title.text){var U=t.select("g.title-group text").style(B).text(f.title.text),q=U.node().getBBox();U.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(F);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});function W(t,e){return s(t)%360+f.orientation}if(f.radialAxis.visible){var Z=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),H.selectAll(".domain").style(F),H.selectAll("g>text").text((function(t,e){return this.textContent+f.radialAxis.ticksSuffix})).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),J=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),X.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(f.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(f.minorTicks+1)==0)})).style(F),J.selectAll(".minor").style({stroke:f.minorTickColor}),X.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var K=X.select("text.axis-text").attr({x:x+f.labelOffset,dy:i+"em",transform:function(t,e){var r=W(t),n=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix})).style(B);f.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)}));var Q=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));D.attr({transform:"translate("+[x+Q,f.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||$){var et=[];p.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var ht=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(Y).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(x+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ft=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(Y).radius;ft.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Y).radius);var a=o.util.convertToCartesian(n,f.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ft.style({opacity:0}),ut.hide(),lt.hide(),ct.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,h=this.getBoundingClientRect(),f=t.node().getBoundingClientRect(),p=[h.left+h.width/2-V[0]-f.left,h.top+h.height/2-V[1]-f.top];ut.config({color:s}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()})).on("mouseout.tooltip",(function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return u},f.getinputConfig=function(){return c},f.radialScale=function(t){return r},f.angularScale=function(t){return s},f.svg=function(){return t},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,a,i)},"stroke-width":function(t,e){return d["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,a,i)},opacity:function(t,e){return d.opacity(r,a,i)},display:function(t,e){return d.display(r,a,i)}})}};var h=e.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(t){return-f/2})).endAngle((function(t){return f/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var m=g.selectAll("path.mark").data((function(t,e){return t}));m.enter().append("path").attr({class:"mark"}),m.style(d).each(c[e.geometryType]),m.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,h=u?e.height:c*o.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),p=f.enter().append("svg").attr({width:300,height:h+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var d=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(d).range(l),m=n.scale[u?"linear":"ordinal"]().domain(d)[u?"range":"rangePoints"]([0,h]);if(u){var v=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=f.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(m).orient("right"),b=f.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",h=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(h);var f=i.padding,p=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},g=p.width+2*f+l,m=p.height+2*f;return r.attr({d:"M"+[[l,-m/2],[l,-m/4],[i.hasTick?0:l,0],[l,m/4],[l,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-m/2+2*f]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach((function(t,e){u[c[l.indexOf(t.key)]]=t.value})),s.margin=u}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}};return t}},{"../../../constants/alignment":704,"../../../lib":735,d3:165}],856:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,h=new s;function f(r,s){return s&&(u=s),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return f.isPolar=!0,f.svg=function(){return a.svg()},f.getConfig=function(){return e},f.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},f.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},f.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,h.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},f.undo=function(){h.undo()},f.redo=function(){h.redo()},f},c.fillLayout=function(t){var e=n.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:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":602,"../../../lib":735,"./micropolar":855,"./undo_manager":857,d3:165}],857:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=90||s>90&&l>=450?1:u<=0&&f<=0?0:Math.max(u,f);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&h>=0?0:Math.min(c,h);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&f>=0?0:Math.min(u,f);n=l>=360?1:c<=0&&h<=0?0:Math.max(c,h);return[e,r,n,a]}(f),x=y[2]-y[0],b=y[3]-y[1],_=h/u,w=Math.abs(b/x);_>w?(p=u,v=(h-(d=u*w))/n.h/2,g=[o[0],o[1]],m=[c[0]+v,c[1]-v]):(d=h,v=(u-(p=h/w))/n.w/2,g=[o[0]+v,o[1]-v],m=[c[0],c[1]]),this.xLength2=p,this.yLength2=d,this.xDomain2=g,this.yDomain2=m;var T=this.xOffset2=n.l+n.w*g[0],k=this.yOffset2=n.t+n.h*(1-m[1]),A=this.radius=p/x,M=this.innerRadius=e.hole*A,S=this.cx=T-A*y[0],L=this.cy=k+A*y[3],P=this.cxx=S-T,I=this.cyy=L-k;this.radialAxis=this.mockAxis(t,e,a,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[a.side],domain:[M/n.w,A/n.w]}),this.angularAxis=this.mockAxis(t,e,i,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:m});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",R(P,I)),r.frontplot.attr("transform",R(T,k)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",R(S,L)).call(s.fill,e.bgcolor)},I.mockAxis=function(t,e,r,n){var a=o.extendFlat({},r,n);return f(a,e,t),a},I.mockCartesianAxis=function(t,e,r){var n=this,a=r._id,i=o.extendFlat({type:"linear"},r);h(i,t);var s={x:[0,2],y:[1,3]};return i.setRange=function(){var t=n.sectorBBox,r=s[a],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);i.range=[t[r[0]]*l,t[r[1]]*l]},i.isPtWithinRange="x"===a?function(t){return n.isPtInside(t)}:function(){return!0},i.setRange(),i.setScale(),i},I.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,a=e.radialaxis;n.setScale(),p(r,n);var i=n.range;a.range=i.slice(),a._input.range=i.slice(),n._rl=[n.r2l(i[0],null,"gregorian"),n.r2l(i[1],null,"gregorian")]},I.updateRadialAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,h=r.cy,f=e.radialaxis,p=E(e.sector[0],360),d=r.radialAxis,g=l90&&p<=270&&(d.tickangle=180);var m=function(t){return"translate("+(d.l2p(t.x)+l)+",0)"},v=z(f);if(r.radialTickLayout!==v&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=v),g){d.setScale();var y=u.calcTicks(d),x=u.clipEnds(d,y),b=u.getTickSigns(d)[2];u.drawTicks(n,d,{vals:y,layer:a["radial-axis"],path:u.makeTickPath(d,0,b),transFn:m,crisp:!1}),u.drawGrid(n,d,{vals:x,layer:a["radial-grid"],path:function(t){return r.pathArc(d.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),u.drawLabels(n,d,{vals:y,layer:a["radial-axis"],transFn:m,labelFns:u.makeLabelFns(d,0)})}var _=r.radialAxisAngle=r.vangles?L(O(C(f.angle),r.vangles)):f.angle,w=R(c,h),T=w+F(-_);D(a["radial-axis"],g&&(f.showticklabels||f.ticks),{transform:T}),D(a["radial-grid"],g&&f.showgrid,{transform:w}),D(a["radial-line"].select("line"),g&&f.showline,{x1:l,y1:0,x2:i,y2:0,transform:T}).attr("stroke-width",f.linewidth).call(s.stroke,f.linecolor)},I.updateRadialAxisTitle=function(t,e,r){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=e.radialaxis,c=this.id+"title",u=void 0!==r?r:this.radialAxisAngle,h=C(u),f=Math.cos(h),p=Math.sin(h),d=0;if(s.title){var g=l.bBox(this.layers["radial-axis"].node()).height,m=s.title.font.size;d="counterclockwise"===s.side?-g-.4*m:g+.8*m}this.layers["radial-axis-title"]=v.draw(n,c,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:S(n,"Click to enter radial axis title"),attributes:{x:i+a/2*f+d*p,y:o-a/2*p+d*f,"text-anchor":"middle"},transform:{rotate:-u}})},I.updateAngularAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,h=r.cy,f=e.angularaxis,p=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",f.rotation),p.setGeometry(),p.setScale();var d=function(t){return p.t2g(t.x)};"linear"===p.type&&"radians"===p.thetaunit&&(p.tick0=L(p.tick0),p.dtick=L(p.dtick));var g=function(t){return R(c+i*Math.cos(t),h-i*Math.sin(t))},m=u.makeLabelFns(p,0).labelStandoff,v={xFn:function(t){var e=d(t);return Math.cos(e)*m},yFn:function(t){var e=d(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(m+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*k)},anchorFn:function(t){var e=d(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=d(t);return-.5*(1+Math.sin(n))*r}},y=z(f);r.angularTickLayout!==y&&(a["angular-axis"].selectAll("."+p._id+"tick").remove(),r.angularTickLayout=y);var x,b=u.calcTicks(p);if("linear"===e.gridshape?(x=b.map(d),o.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,"category"===p.type&&(b=b.filter((function(t){return o.isAngleInsideSector(d(t),r.sectorInRad)}))),p.visible){var _="inside"===p.ticks?-1:1,w=(p.linewidth||1)/2;u.drawTicks(n,p,{vals:b,layer:a["angular-axis"],path:"M"+_*w+",0h"+_*p.ticklen,transFn:function(t){var e=d(t);return g(e)+F(-L(e))},crisp:!1}),u.drawGrid(n,p,{vals:b,layer:a["angular-grid"],path:function(t){var e=d(t),r=Math.cos(e),n=Math.sin(e);return"M"+[c+l*r,h-l*n]+"L"+[c+i*r,h-i*n]},transFn:o.noop,crisp:!1}),u.drawLabels(n,p,{vals:b,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return g(d(t))},labelFns:v})}D(a["angular-line"].select("path"),f.showline,{d:r.pathSubplot(),transform:R(c,h)}).attr("stroke-width",f.linewidth).call(s.stroke,f.linecolor)},I.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},I.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=A.MINZOOM,c=A.OFFEDGE,u=e.radius,h=e.innerRadius,f=e.cx,p=e.cy,v=e.cxx,_=e.cyy,w=e.sectorInRad,T=e.vangles,k=e.radialAxis,S=M.clampTiny,E=M.findXYatLength,C=M.findEnclosingVertexAngles,L=A.cornerHalfWidth,P=A.cornerLen/2,I=d.makeDragger(o,"path","maindrag","crosshair");n.select(I).attr("d",e.pathSubplot()).attr("transform",R(f,p));var z,O,D,F,B,N,j,V,U,q={element:I,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function H(t,e){return Math.sqrt(t*t+e*e)}function G(t,e){return H(t-v,e-_)}function Y(t,e){return Math.atan2(_-e,t-v)}function W(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Z(t,r){if(0===t)return e.pathSector(2*L);var n=P/t,a=r-n,i=r+n,o=Math.max(0,Math.min(t,u)),s=o-L,l=o+L;return"M"+W(s,a)+"A"+[s,s]+" 0,0,0 "+W(s,i)+"L"+W(l,i)+"A"+[l,l]+" 0,0,1 "+W(l,a)+"Z"}function X(t,r,n){if(0===t)return e.pathSector(2*L);var a,i,o=W(t,r),s=W(t,n),l=S((o[0]+s[0])/2),c=S((o[1]+s[1])/2);if(l&&c){var u=c/l,h=-1/u,f=E(L,u,l,c);a=E(P,h,f[0][0],f[0][1]),i=E(P,h,f[1][0],f[1][1])}else{var p,d;c?(p=P,d=L):(p=L,d=P),a=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+a.join("L")+"L"+i.reverse().join("L")+"Z"}function J(t,e){return e=Math.max(Math.min(e,u),h),tl?(t-1&&1===t&&x(n,r,[e.xaxis],[e.yaxis],e.id,q),a.indexOf("event")>-1&&m.click(r,n,e.id)}q.prepFn=function(t,n,i){var o=r._fullLayout.dragmode,l=I.getBoundingClientRect();if(z=n-l.left,O=i-l.top,T){var c=M.findPolygonOffset(u,w[0],w[1],T);z+=v+c[0],O+=_+c[1]}switch(o){case"zoom":q.moveFn=T?tt:Q,q.clickFn=nt,q.doneFn=et,function(){D=null,F=null,B=e.pathSubplot(),N=!1;var t=r._fullLayout[e.id];j=a(t.bgcolor).getLuminance(),(V=d.makeZoombox(s,j,f,p,B)).attr("fill-rule","evenodd"),U=d.makeCorners(s,f,p),b(r)}();break;case"select":case"lasso":y(t,n,i,q,o)}},I.onmousemove=function(t){m.hover(r,t,e.id),r._fullLayout._lasthover=I,r._fullLayout._hoversubplot=e.id},I.onmouseout=function(t){r._dragging||g.unhover(r,t)},g.init(q)},I.updateRadialDrag=function(t,e,r){var a=this,s=a.gd,l=a.layers,c=a.radius,u=a.innerRadius,h=a.cx,f=a.cy,p=a.radialAxis,m=A.radialDragBoxSize,v=m/2;if(p.visible){var y,x,_,k=C(a.radialAxisAngle),M=p._rl,S=M[0],E=M[1],P=M[r],I=.75*(M[1]-M[0])/(1-e.hole)/c;r?(y=h+(c+v)*Math.cos(k),x=f-(c+v)*Math.sin(k),_="radialdrag"):(y=h+(u-v)*Math.cos(k),x=f-(u-v)*Math.sin(k),_="radialdrag-inner");var z,B,N,j=d.makeRectDragger(l,_,"crosshair",-v,-v,m,m),V={element:j,gd:s};D(n.select(j),p.visible&&u0==(r?N>S:Nn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*i},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var a=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(a(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,a){var i,o,s=e[a],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(i=new Array(l),o=0;o0){for(var n=[],a=0;a=u&&(p.min=0,g.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var f=o("color"),p=f!==a.color.dflt?f:r.font.color,d=e._name.charAt(0).toUpperCase(),g="Component "+d,m=o("title.text",g);e._hovertitle=m===g?m:d,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":602,"../../lib":735,"../../plot_api/plot_template":773,"../cartesian/line_grid_defaults":799,"../cartesian/tick_label_defaults":804,"../cartesian/tick_mark_defaults":805,"../cartesian/tick_value_defaults":806,"../subplot_defaults":860,"./layout_attributes":863}],865:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,f=t("../plots"),p=t("../cartesian/axes"),d=t("../../components/dragelement"),g=t("../../components/fx"),m=t("../../components/dragelement/helpers"),v=m.freeMode,y=m.rectMode,x=t("../../components/titles"),b=t("../cartesian/select").prepSelect,_=t("../cartesian/select").selectOnClick,w=t("../cartesian/select").clearSelect,T=t("../cartesian/select").clearSelectionsCache,k=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var M=A.prototype;M.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},M.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*x?a=(i=x)*S:i=(a=y)/S,o=m*a/y,s=v*i/x,r=e.l+e.w*d-a/2,n=e.t+e.h*(1-g)-i/2,f.x0=r,f.y0=n,f.w=a,f.h=i,f.sum=b,f.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[d-o/2,d+o/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(t){return t.a>=f.aaxis.range[0]&&t.a<=f.aaxis.range[1]&&t.b>=f.baxis.range[1]&&t.b<=f.baxis.range[0]&&t.c>=f.caxis.range[1]&&t.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[_,b-w-T],domain:[g-s/2,g+s/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var k=f.yaxis.domain[0],A=f.aaxis=h({},t.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});u(A,f.graphDiv._fullLayout),A.setScale();var M=f.baxis=h({},t.baxis,{range:[b-_-T,w],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(M,f.graphDiv._fullLayout),M.setScale();var E=f.caxis=h({},t.caxis,{range:[b-_-w,T],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});u(E,f.graphDiv._fullLayout),E.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";f.clipDef.select("path").attr("d",C),f.layers.plotbg.select("path").attr("d",C);var L="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";f.clipDefRelative.select("path").attr("d",L);var P="translate("+r+","+n+")";f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),f.clipDefRelative.select("path").attr("transform",null);var I="translate("+(r-M._offset)+","+(n+i)+")";f.layers.baxis.attr("transform",I),f.layers.bgrid.attr("transform",I);var z="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-A._offset+")";f.layers.aaxis.attr("transform",z),f.layers.agrid.attr("transform",z);var O="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-E._offset+")";f.layers.caxis.attr("transform",O),f.layers.cgrid.attr("transform",O),f.drawAxes(!0),f.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",M.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",E.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},M.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=x.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=x.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},M.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,s=this.layers[n],l=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+i+"tick").remove(),this[l]=c),t.setScale();var u=p.calcTicks(t),h=p.clipEnds(t,u),f=p.makeTransFn(t),d=p.getTickSigns(t)[2],g=o.deg2rad(30),m=d*(t.linewidth||1)/2,v=d*t.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+m+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+m+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];p.drawTicks(r,t,{vals:"inside"===t.ticks?h:u,layer:s,path:b,transFn:f,crisp:!1}),p.drawGrid(r,t,{vals:h,layer:this.layers[a+"grid"],path:_,transFn:f,crisp:!1}),p.drawLabels(r,t,{vals:u,layer:s,transFn:f,labelFns:p.makeLabelFns(t,0,30)})};var E=k.MINZOOM/2+.87,C="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",L="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",P="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",I=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}M.clearSelect=function(){T(this.dragOptions),w(this.dragOptions.gd)},M.initInteractions=function(){var t,e,r,n,u,h,f,p,m,x,w=this,T=w.layers.plotbg.select("path").node(),A=w.graphDiv,M=A._fullLayout._zoomlayer;function E(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function O(t,e){var r=A._fullLayout.clickmode;z(A),2===t&&(A.emit("plotly_doubleclick",null),i.call("_guiRelayout",A,E({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&_(e,A,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&g.click(A,e,w.id)}function D(t,e){return 1-e/w.h}function R(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function F(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function B(a,i){var o=t+a,s=e+i,l=Math.max(0,Math.min(1,D(0,e),D(0,s))),c=Math.max(0,Math.min(1,R(t,e),R(o,s))),d=Math.max(0,Math.min(1,F(t,e),F(o,s))),g=(l/2+d)*w.w,v=(1-l/2-c)*w.w,y=(g+v)/2,b=v-g,_=(1-l)*w.h,T=_-b/S;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),x.transition().style("opacity",1).duration(200),p=!0),A.emit("plotly_relayouting",E(u))}function N(){z(A),u!==r&&(i.call("_guiRelayout",A,E(u)),I&&A.data&&A._context.showTips&&(o.notifier(s(A,"Double-click to zoom back out"),"long"),I=!1))}function j(t,e){var n=t/w.xaxis._m,a=e/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),s=i.indexOf(u.b),l=i.indexOf(u.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),u={a:i[o],b:i[s],c:i[l]},e=(r.a-u.a)*w.yaxis._m,t=(r.c-u.c-r.b+u.b)*w.xaxis._m);var h="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var f="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",f),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),A.emit("plotly_relayouting",E(u))}function V(){i.call("_guiRelayout",A,E(u))}this.dragOptions={element:T,gd:A,plotinfo:{id:w.id,domain:A._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,s){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis];var c=w.dragOptions.dragmode=A._fullLayout.dragmode;v(c)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===c?(w.dragOptions.moveFn=B,w.dragOptions.clickFn=O,w.dragOptions.doneFn=N,function(i,o,s){var c=T.getBoundingClientRect();t=o-c.left,e=s-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,h=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),f="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,m=M.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",f),x=M.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearSelect(A)}(0,o,s)):"pan"===c?(w.dragOptions.moveFn=j,w.dragOptions.clickFn=O,w.dragOptions.doneFn=V,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,w.clearSelect(A)):(y(c)||v(c))&&b(i,o,s,w.dragOptions,c)}},T.onmousemove=function(t){g.hover(A,t,w.id),A._fullLayout._lasthover=T,A._fullLayout._hoversubplot=w.id},T.onmouseout=function(t){A._dragging||d.unhover(A,t)},d.init(this.dragOptions)}},{"../../components/color":602,"../../components/dragelement":621,"../../components/dragelement/helpers":620,"../../components/drawing":624,"../../components/fx":642,"../../components/titles":697,"../../lib":735,"../../lib/extend":726,"../../registry":866,"../cartesian/axes":783,"../cartesian/constants":789,"../cartesian/select":802,"../cartesian/set_convert":803,"../plots":846,d3:165,tinycolor2:535}],866:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),h=l.extendFlat,f=l.extendDeepAll;function p(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(h[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":602,"../components/drawing":624,"../constants/xmlns_namespaces":712,"../lib":735,d3:165}],875:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rh+c||!n(u))}for(var p=0;pi))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?a+=i:e<0&&(a-=i)}return n.inbox(r-e,a-e,b+(a-e)/(a-r)-1)}"h"===m.orientation?(i=r,s=e,u="y",h="x",f=S,p=M):(i=e,s=r,u="x",h="y",p=S,f=M);var E=t[u+"a"],C=t[h+"a"];d=Math.abs(E.r2c(E.range[1])-E.r2c(E.range[0]));var L=n.getDistanceFunction(a,f,p,(function(t){return(f(t)+p(t))/2}));if(n.getClosest(g,L,t),!1!==t.index&&g[t.index].p!==c){y||(T=function(t){return Math.min(_(t),t.p-v.bargroupwidth/2)},k=function(t){return Math.max(w(t),t.p+v.bargroupwidth/2)});var P=g[t.index],I=m.base?P.b+P.s:P.s;t[h+"0"]=t[h+"1"]=C.c2p(P[h],!0),t[h+"LabelVal"]=I;var z=v.extents[v.extents.round(P.p)];return t[u+"0"]=E.c2p(y?T(P):z[0],!0),t[u+"1"]=E.c2p(y?k(P):z[1],!0),t[u+"LabelVal"]=P.p,t.labelLabel=l(E,t[u+"LabelVal"]),t.valueLabel=l(C,t[h+"LabelVal"]),t.spikeDistance=(S(P)+function(t){return A(_(t),w(t))}(P))/2-b,t[u+"Spike"]=E.c2p(P.p,!0),o(P,m,t),t.hovertemplate=m.hovertemplate,t}}function h(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=s(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n){var i=u(t,e,r,n);if(i){var o=i.cd,s=o[0].trace,l=o[i.index];return i.color=h(s,l),a.getComponentMethod("errorbars","hoverInfo")(l,s,i),[i]}},hoverOnBars:u,getTraceColor:h}},{"../../components/color":602,"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"./helpers":882}],884:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":796,"../scatter/marker_colorbar":1158,"./arrays_to_calcdata":875,"./attributes":876,"./calc":877,"./cross_trace_calc":879,"./defaults":880,"./event_data":881,"./hover":883,"./layout_attributes":885,"./layout_defaults":886,"./plot":887,"./select":888,"./style":890}],885:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],886:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return i.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,h={},f=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function C(t,e,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,c=i.anchor||"end",u="end"===c,h="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,d=a.width,g=a.height,m=Math.abs(e-t),v=Math.abs(n-r),y=m>2*_&&v>2*_?_:0;m-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=m&&g<=v||!(d>m||g>v)||(d>v||g>m)&&d.01?H:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?H(t):t>e?Math.ceil(t):Math.floor(t)};B=G(B,N,D),N=G(N,B,D),j=G(j,V,!D),V=G(V,j,!D)}var Y=A(i.ensureSingle(I,"path"),P,m,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(V-j))?"M0,0Z":"M"+B+","+j+"V"+V+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(h);l.singlePointStyle(c,Y,h,W,t)}!function(t,e,r,n,a,s,c,h,p,m,v){var w,T=e.xaxis,M=e.yaxis,L=t._fullLayout;function P(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,z="h"===I.orientation,O=function(t,e,r,n,a){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,c,h,f,p="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=a,h="x",f=n):(l="x",c=n,h="y",f=a);function g(t){return u(f,+t,!0).text}var m=e[r],v={};v.label=m.p,v.labelLabel=v[l+"Label"]=(y=m.p,u(c,y,!0).text);var y;var x=i.castOption(o,m.i,"text");(0===x||x)&&(v.text=x);v.value=m.s,v.valueLabel=v[h+"Label"]=g(m.s);var _={};b(_,o,m.i),p&&(v.delta=+m.rawS||m.s,v.deltaLabel=g(v.delta),v.final=m.v,v.finalLabel=g(v.final),v.initial=v.final-v.delta,v.initialLabel=g(v.initial));d&&(v.value=m.s,v.valueLabel=g(v.value),v.percentInitial=m.begR,v.percentInitialLabel=i.formatPercent(m.begR),v.percentPrevious=m.difR,v.percentPreviousLabel=i.formatPercent(m.difR),v.percentTotal=m.sumR,v.percenTotalLabel=i.formatPercent(m.sumR));var w=i.castOption(o,m.i,"customdata");w&&(v.customdata=w);return i.texttemplateString(s,v,t._d3locale,_,v,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function c(t){return u(o?r:n,+t,!0).text}var h,f=a.textinfo,p=t[e],d=f.split("+"),g=[],m=function(t){return-1!==d.indexOf(t)};m("label")&&g.push((v=t[e].p,u(o?n:r,v,!0).text));var v;m("text")&&(0===(h=i.castOption(a,p.i,"text"))||h)&&g.push(h);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;m("initial")&&g.push(c(b)),m("delta")&&g.push(c(y)),m("final")&&g.push(c(x))}if(l){m("value")&&g.push(c(p.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(h=i.formatPercent(p.begR),w&&(h+=" of initial"),g.push(h)),m("percent previous")&&(h=i.formatPercent(p.difR),w&&(h+=" of previous"),g.push(h)),m("percent total")&&(h=i.formatPercent(p.sumR),w&&(h+=" of total"),g.push(h))}return g.join("
")}(e,r,n,a):g.getValue(s.text,r);return g.coerceString(y,o)}(L,n,a,T,M);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(I,a);var D="stack"===m.mode||"relative"===m.mode,R=n[a],F=!D||R._outmost;if(!O||"none"===w||(R.isBlank||s===c||h===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=L.font,N=d.getBarColor(n[a],I),j=d.getInsideTextFont(I,a,B,N),V=d.getOutsideTextFont(I,a,B),U=r.datum();z?"log"===T.type&&U.s0<=0&&(s=T.range[0]=G*(X/Y):X>=Y*(Z/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){W=i.ensureUniformFontSize(t,"outside"===w?V:j);var $=(q=P(r,O,W)).attr("transform");if(q.attr("transform",""),H=l.bBox(q.node()),G=H.width,Y=H.height,q.attr("transform",$),G<=0||Y<=0)return void q.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,a,i){var o,s=!!i.isHorizontal,l=!!i.constrained,c=i.angle||0,u=a.width,h=a.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:f>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var g=S(c),m=E(a,g),v=(s?m.x:m.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);s?(b=e-M*o,T=M*v):(w=n+M*o,A=-M*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:g}}(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=C(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,f(I.type,tt,L),R.transform=tt,A(q,L,m,v).attr("transform",i.getTextTransform(tt))}(t,e,I,r,p,B,N,j,V,m,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,L,h.xcalendar,h.ycalendar)}));var j=!1===h.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,m)},toMoveInsideBar:C}},{"../../components/color":602,"../../components/drawing":624,"../../components/fx/helpers":638,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../registry":866,"./attributes":876,"./constants":878,"./helpers":882,"./style":890,"./uniform_text":892,d3:165,"fast-isnumeric":237}],888:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(i+o)/2,l]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,s=a[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:g,styleOnSelect:function(t,e,r){var a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var a,s=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,m(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(a.color=l),i.font(s,a)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(d(r,a,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":602,"../../components/drawing":624,"../../lib":735,"../../registry":866,"./attributes":876,"./helpers":882,"./uniform_text":892,d3:165}],891:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),a(t,"marker")&&i(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":602,"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613}],892:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=of.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return g(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?m+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=a.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":642,"../../lib":735,"../../plots/polar/helpers":848,"../bar/hover":883,"../scatterpolar/hover":1217}],897:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":849,"../bar/select":888,"../bar/style":890,"../scatter/marker_colorbar":1158,"../scatterpolar/format_labels":1216,"./attributes":893,"./calc":894,"./defaults":895,"./hover":896,"./layout_attributes":898,"./layout_defaults":899,"./plot":900}],898:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],899:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i,o={};function s(r,o){return n.coerce(t[i]||{},e[i],a,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var h=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,a,c,u,h,e,r)};return function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=i.ensureSingle(r,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=h.c2g(t.p0),d=t.thetag1=h.c2g(t.p1);if(a(o)&&a(s)&&a(p)&&a(d)&&o!==s&&p!==d){var g=u.c2g(t.s1),m=(p+d)/2;t.ct=[l.c2p(g*Math.cos(m)),c.c2p(g*Math.sin(m))],e=f(o,s,p,d)}else e="M0,0Z";i.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":624,"../../lib":735,"../../plots/polar/helpers":848,d3:165,"fast-isnumeric":237}],901:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../lib/extend").extendFlat,l=n.marker,c=l.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},c.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:s({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":601,"../../lib/extend":726,"../../plots/template_attributes":861,"../bar/attributes":876,"../scatter/attributes":1140}],902:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("../../constants/numerical").BADNUM,s=i._;e.exports=function(t,e){var r,l,v,y,x,b,_=t._fullLayout,w=a.getFromId(t,e.xaxis||"x"),T=a.getFromId(t,e.yaxis||"y"),k=[],A="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=w,y="x",x=T,b="y"):(v=T,y="y",x=w,b="x");var M,S,E,C,L,P,I=function(t,e,r,a){var o,s=e+"0"in t,l="d"+e in t;if(e in t||s&&l)return r.makeCalcdata(t,e);o=s?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:a;for(var c="multicategory"===r.type?r.r2c_just_indices(o):r.d2c(o,0,t[e+"calendar"]),u=t._length,h=new Array(u),f=0;fM.uf};if(e._hasPreCompStats){var F=e[y],B=function(t){return v.d2c((e[t]||[])[r])},N=1/0,j=-1/0;for(r=0;r=M.q1&&M.q3>=M.med){var U=B("lowerfence");M.lf=U!==o&&U<=M.q1?U:f(M,E,C);var q=B("upperfence");M.uf=q!==o&&q>=M.q3?q:p(M,E,C);var H=B("mean");M.mean=H!==o?H:C?i.mean(E,C):(M.q1+M.q3)/2;var G=B("sd");M.sd=H!==o&&G>=0?G:C?i.stdev(E,C,M.mean):M.q3-M.q1,M.lo=d(M),M.uo=g(M);var Y=B("notchspan");Y=Y!==o&&Y>0?Y:m(M,C),M.ln=M.med-Y,M.un=M.med+Y;var W=M.lf,Z=M.uf;e.boxpoints&&E.length&&(W=Math.min(W,E[0]),Z=Math.max(Z,E[C-1])),e.notched&&(W=Math.min(W,M.ln),Z=Math.max(Z,M.un)),M.min=W,M.max=Z}else{var X;i.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+M.q1,"median = "+M.med,"q3 = "+M.q3].join("\n")),X=M.med!==o?M.med:M.q1!==o?M.q3!==o?(M.q1+M.q3)/2:M.q1:M.q3!==o?M.q3:0,M.med=X,M.q1=M.q3=X,M.lf=M.uf=X,M.mean=M.sd=X,M.ln=M.un=X,M.min=M.max=X}N=Math.min(N,M.min),j=Math.max(j,M.max),M.pts2=S.filter(R),k.push(M)}}e._extremes[v._id]=a.findExtremes(v,[N,j],{padded:!0})}else{var J=v.makeCalcdata(e,y),K=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a=0&&tt0){var ot,st;if((M={}).pos=M[b]=O[r],S=M.pts=$[r].sort(u),C=(E=M[y]=S.map(h)).length,M.min=E[0],M.max=E[C-1],M.mean=i.mean(E,C),M.sd=i.stdev(E,C,M.mean),M.med=i.interp(E,.5),C%2&&(at||it))at?(ot=E.slice(0,C/2),st=E.slice(C/2+1)):it&&(ot=E.slice(0,C/2+1),st=E.slice(C/2)),M.q1=i.interp(ot,.5),M.q3=i.interp(st,.5);else M.q1=i.interp(E,.25),M.q3=i.interp(E,.75);M.lf=f(M,E,C),M.uf=p(M,E,C),M.lo=d(M),M.uo=g(M);var lt=m(M,C);M.ln=M.med-lt,M.un=M.med+lt,et=Math.min(et,M.ln),rt=Math.max(rt,M.un),M.pts2=S.filter(R),k.push(M)}e._extremes[v._id]=a.findExtremes(v,e.notched?J.concat([et,rt]):J,{padded:!0})}return function(t,e){if(i.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(k[0].t={num:_[A],dPos:D,posLetter:b,valLetter:y,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},_[A]++,k):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)i.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?i.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function f(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(i.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(i.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function m(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"fast-isnumeric":237}],903:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],g=0;for(s=0;s1,b=1-h[t+"gap"],_=1-h[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;H+G>=0&&((W=U*(H+G))>M?(q=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var Z=0;H-G<=0&&((Z=-U*(H-G))>S?(q=!0,V=Y,N=Z):Z>F&&(V=Y,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(m="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(m="h",v=Math.min(_)):v=0;if(v){e._length=v;var A=r("orientation",m);e._hasPreCompStats?"v"===A&&0===x?(r("x0",0),r("dx",1)):"h"===A&&0===y&&(r("y0",0),r("dy",1)):"v"===A&&0===x?r("x0"):"h"===A&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i)}else e.visible=!1}function u(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=r(i+"points",c);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var h=r("hoveron");"all"!==h&&-1===h.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function o(r,a){return n.coerce(t,e,l,r,a)}if(c(t,e,o,a),!1!==e.visible){var s=e._hasPreCompStats;s&&(o("lowerfence"),o("upperfence")),o("line.color",(t.marker||{}).color||r),o("line.width"),o("fillcolor",i.addOpacity(e.line.color,.5));var h=!1;if(s){var f=o("mean"),p=o("sd");f&&f.length&&(h=!0,p&&p.length&&(h="sd"))}o("boxmean",h),o("whiskerwidth"),o("width"),o("quartilemethod");var d=!1;if(s){var g=o("notchspan");g&&g.length&&(d=!0)}else n.validate(t.notchwidth,l.notchwidth)&&(d=!0);o("notched",d)&&o("notchwidth"),u(t,e,o,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,l,t)}for(var s=0;st.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function l(t,e,r,i){var o,s,l=e.pos,c=e.val,u=i.bPos,h=i.bPosPxOffset||0,f=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(t){var e=l.c2l(t.pos+u,!0),a=l.l2p(e)+h,i=l.l2p(e-o)+h,p=l.l2p(e+s)+h,d=c.c2p(t.mean,!0),g=c.c2p(t.mean-t.sd,!0),m=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+d+","+i+"V"+p+("sd"===f?"m0,0L"+g+","+a+"L"+d+","+i+"L"+m+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+d+"H"+p+("sd"===f?"m0,0L"+a+","+g+"L"+i+","+d+"L"+a+","+m+"Z":""))}))}e.exports={plot:function(t,e,r,i){var c=e.xaxis,u=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],h=i.t,f=i.trace;(h.wdPos=h.bdPos*f.whiskerwidth,!0!==f.visible||h.empty)?a.remove():("h"===f.orientation?(e=u,r=c):(e=c,r=u),o(a,{pos:e,val:r},f,h),s(a,{x:c,y:u},f,h),l(a,{pos:e,val:r},f,h))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":624,"../../lib":735,d3:165}],911:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var a=1/0,i=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,D=P(S+L),R=I(E-L),F=[[h=M(S)]];for(i=D;i*C=0;a--)i[u-a]=t[h][a],o[u-a]=e[h][a];for(s.push({x:i,y:o,bicubic:l}),a=h,i=[],o=[];a>=0;a--)i[h-a]=t[a][0],o[h-a]=e[a][0];return s.push({x:i,y:o,bicubic:c}),s}},{}],925:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var i,o,s,l,c,u,h,f,p,d,g,m,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,C=M.length,L=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function z(n){var a,i,o,s,l,c,u,h,p,d,g,m,v=[],y=[],x={};if("b"===e)for(i=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=L,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},a=0;a0&&(p=t.dxydi([],a-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],a-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(a=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,a))),u=a-c,x.length=L,x.crossLength=P,x.xy=function(e){return t.evalxy([],a,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(g=t.dxydj([],c,i-1,u,0),v.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),m=t.dxydj([],c,i-1,u,1),v.push(h[0]-m[0]/3),y.push(h[1]-m[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=f,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function O(n){var a,i,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),h.xy=function(e){return t.evalxy([],e,n)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},a=0;ax.length-1||_.push(a(O(o),{color:b.gridcolor,width:b.gridwidth}));for(f=u;fx.length-1||g<0||g>x.length-1))for(m=x[s],v=x[g],i=0;ix[x.length-1]||w.push(a(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(a(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(a(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],f=u;f<=h;f++)p=b.tick0+b.dtick*f,_.push(a(z(p),{color:b.gridcolor,width:b.gridwidth}));for(f=u-1;fx[x.length-1]||w.push(a(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(a(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(a(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":726,"../../plots/cartesian/axes":783}],926:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,i,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],a=0;a90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],940:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=t("../../constants/alignment");function h(t,e,r,a,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var a=r,s=a.x,l=a.y,c=i([],s,t.c2p),u=i([],l,e.c2p),h="M"+o(c,u,a.smoothing);n.select(this).attr("d",h).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),u.exit().remove()}function f(t,e,r,i,o,c,u,h){var f=c.selectAll("text."+h).data(u);f.enter().append("text").classed(h,!0);var p=0,d={};return f.each((function(o,c){var u;if("auto"===o.axis.tickangle)u=s(i,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;u=s(i,e,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(d={angle:u.angle,flip:u.flip});var f=(o.endAnchor?-1:1)*u.flip,g=n.select(this).attr({"text-anchor":f>0?"start":"end","data-notex":1}).call(a.font,o.font).text(o.text).call(l.convertToTspans,t),m=a.bBox(this);g.attr("transform","translate("+u.p[0]+","+u.p[1]+") rotate("+u.angle+")translate("+o.axis.labelpadding*f+","+.3*m.height+")"),p=Math.max(p,m.width+o.axis.labelpadding)})),f.exit().remove(),d.maxExtent=p,d}e.exports=function(t,e,r,a){var l=e.xaxis,u=e.yaxis,p=t._fullLayout._clips;c.makeTraceGroups(a,r,"trace").each((function(e){var r=n.select(this),a=e[0],d=a.trace,m=d.aaxis,v=d.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",d.opacity),h(l,u,x,m,"a",m._gridlines),h(l,u,x,v,"b",v._gridlines),h(l,u,y,m,"a",m._minorgridlines),h(l,u,y,v,"b",v._minorgridlines),h(l,u,b,m,"a-boundary",m._boundarylines),h(l,u,b,v,"b-boundary",v._boundarylines);var w=f(t,l,u,d,a,_,m._labels,"a-label"),T=f(t,l,u,d,a,_,v._labels,"b-label");!function(t,e,r,n,a,i,o,l){var u,h,f,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),v=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),h=v,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===o.angle&&c.extendFlat(o,s(r,a,i,f,r.dxydb_rough(u,h)));g(t,e,r,n,f,p,r.aaxis,a,i,o,"a-title"),u=d,h=.5*(v+y),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===l.angle&&c.extendFlat(l,s(r,a,i,f,r.dxyda_rough(u,h)));g(t,e,r,n,f,p,r.baxis,a,i,l,"b-title")}(t,_,d,a,l,u,w,T),function(t,e,r,n,a){var s,l,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,g=[];for(h=0;h90&&m<270,y=n.select(this);y.text(u.title.text).call(l.convertToTspans,t),v&&(x=(-l.lineCount(y)+d)*p*i-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(a.font,u.title.font)})),y.exit().remove()}},{"../../components/drawing":624,"../../constants/alignment":704,"../../lib":735,"../../lib/svg_text_utils":759,"./makepath":937,"./map_1d_array":938,"./orient_text":939,d3:165}],941:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/search").findBin,i=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[c-1],g=r[0],m=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,g-=b,m+=b,t.isVisible=function(t,e){return t>p&&tg&&ed||em},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(a(t,e),c-2)),n=e[r],i=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(i-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(a(t,r),u-2)),n=r[e],i=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(i-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,a,i){if(!i&&(ne[c-1]|ar[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(a),l=t.evalxy([],o,s);if(i){var h,f,p,d,g=0,m=0,v=[];ne[c-1]?(h=c-2,f=1,g=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ar[u-1]?(p=u-2,d=1,m=(a-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),g&&(t.dxydi(v,h,p,f,d),l[0]+=v[0]*g,l[1]+=v[1]*g),m&&(t.dxydj(v,h,p,f,d),l[0]+=v[0]*m,l[1]+=v[1]*m)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,a){var i=t.dxydi(null,e,r,n,a),o=t.dadi(e,n);return[i[0]/o,i[1]/o]},t.dxydb=function(e,r,n,a){var i=t.dxydj(null,e,r,n,a),o=t.dbdj(r,a);return[i[0]/o,i[1]/o]},t.dxyda_rough=function(e,r,n){var a=v*(n||.1),i=t.ab2xy(e+a,r,!0),o=t.ab2xy(e-a,r,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dxydb_rough=function(e,r,n){var a=y*(n||.1),i=t.ab2xy(e,r+a,!0),o=t.ab2xy(e,r-a,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":754,"./compute_control_points":929,"./constants":930,"./create_i_derivative_evaluator":931,"./create_j_derivative_evaluator":932,"./create_spline_evaluator":933}],942:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var a,i,o,s=[],l=[],c=t[0].length,u=t.length;function h(e,r){var n,a=0,i=0;return e>0&&void 0!==(n=t[r][e-1])&&(i++,a+=n),e0&&void 0!==(n=t[r-1][e])&&(i++,a+=n),r0&&i0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":735}],943:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var a=r("x"),i=a&&a.length,o=r("y"),s=o&&o.length;if(!i&&!s)return!1;if(e._cheater=!a,i&&!n(a)||s&&!n(o))e._length=null;else{var l=i?a.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":735}],944:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":601,"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scattergeo/attributes":1181}],945:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var h=0;h")}(t,h,o,f.mockAxis),[t]}},{"../../lib":735,"../../plots/cartesian/axes":783,"./attributes":944}],949:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":815,"../heatmap/colorbar":1023,"./attributes":944,"./calc":945,"./defaults":946,"./event_data":947,"./hover":948,"./plot":950,"./select":951,"./style":952}],950:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],a=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(t):o(r,a.topojson),h=[],f=[],p=0;p=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":838,"./convert":954}],958:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=i[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../mesh3d/attributes":1081}],959:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,a=e.v,i=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),hc&&(n.prefixBoundary=!0)}}}},{}],966:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=a(e,{isColorbar:!0});if("heatmap"===c){var h=n.extractOpts(e);r._fillgradient=h.reversescale?n.flipScale(h.colorscale):h.colorscale,r._zrange=[h.min,h.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":614,"./end_plus":974,"./make_color_map":979}],967:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],968:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,s=i.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,i,l,h){var f,p,d,g=e.contours,m=r("contours.operation");(g._operation=c[m],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===m?f=g.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),f)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,h)}},{"../../components/color":602,"../../constants/filter_ops":707,"./label_defaults":978,"fast-isnumeric":237}],969:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":707,"fast-isnumeric":237}],970:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],971:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,i,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":735,"./constraint_mapping":969,"./end_plus":974}],974:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],975:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(h,r,e),p=[s(t,e,[-f[0],-f[1]])],d=t.z.length,g=t.z[0].length,m=e.slice(),v=f.slice();for(c=0;c<1e4;c++){if(h>20?(h=a.CHOOSESADDLE[h][(f[0]||f[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[h]):delete t.crossings[u],!(f=a.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}p.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),i(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=f[0]&&(e[0]<0||e[0]>g-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===m[0]&&e[1]===m[1]&&f[0]===v[0]&&f[1]===v[1]||r&&y)break;h=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,A,M,S,E,C,L,P,I,z,O=i(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&S--,t.edgepaths[S]=C.concat(p,E));break}U||(t.edgepaths[M]=p.concat(E))}for(M=0;Mt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,g=2===p||2===d;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):a.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;h+="L"+n}if(s===t.edgepaths.length){a.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=v.EDGECOST*(1/(f-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var g=s-u,m=l-h,y=s+u,x=l+h,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.fontSize,i=e.width+a/3,o=Math.max(0,e.height-a/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[f(-i/2,-o/2),f(-i/2,o/2),f(i/2,o/2),f(i/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:i,height:o}),n.push(p)},r.drawLabels=function(t,e,r,i,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,h=r.end,f=t._input.contours;if(u>h&&(r.start=f.start=h,h=r.end=f.end=u,u=r.start),!(r.size>0))c=u===h?1:i(u,h,t.ncontours).dtick,f.size=r.size=c}}},{"../../lib":735,"../../plots/cartesian/axes":783}],983:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,i=r.contours,s=r.line,l=i.size||1,c=i.start,u="constraint"===i.type,h=!u&&"lines"===i.coloring,f=!u&&"fill"===i.coloring,p=h||f?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)}));var d=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:d.family,size:d.size,color:d.color||(h?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(f){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),p(t.level+.5*l)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*l))}})),i(t)}},{"../../components/drawing":624,"../heatmap/style":1032,"./make_color_map":979,d3:165}],984:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":612,"./label_defaults":978}],985:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=a.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a.line.color,width:a.line.width,dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../contour/attributes":963,"../heatmap/attributes":1020}],986:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../../lib"),i=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),h=t("../carpet/lookup_carpetid"),f=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=h(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var g=function(t,e){var r,u,h,f,p,d,g,m=e._carpetTrace,v=m.aaxis,y=m.baxis;v._minDtick=0,y._minDtick=0,a.isArray1D(e.z)&&i(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,f=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],f=f?y.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,g=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(g),s(g,e._emptypoints);var x=a.maxRowLength(g),b="scaled"===e.xtype?"":r,_=c(e,b,u,h,x,v),w="scaled"===e.ytype?"":f,T=c(e,w,p,d,g.length,y),k={a:_,b:T,z:g};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:g,containerStr:"",cLetter:"z"});return[k]}(t,e);return f(e,e._z),g}}},{"../../components/colorscale/calc":610,"../../lib":735,"../carpet/lookup_carpetid":936,"../contour/set_contours":982,"../heatmap/clean_2d_array":1022,"../heatmap/convert_column_xyz":1024,"../heatmap/find_empties":1026,"../heatmap/interp2d":1029,"../heatmap/make_bound_array":1030,"./defaults":987}],987:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,i,r,a)}if(u("carpet"),t.a&&t.b){if(!a(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,i,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":735,"../contour/constraint_defaults":968,"../contour/contours_defaults":970,"../contour/style_defaults":984,"../heatmap/xyz_defaults":1034,"./attributes":985}],988:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":796,"../contour/colorbar":966,"../contour/style":983,"./attributes":985,"./calc":986,"./defaults":987,"./plot":989}],989:[function(t,e,r){"use strict";var n=t("d3"),a=t("../carpet/map_1d_array"),i=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),h=t("../contour/constants"),f=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),g=t("../carpet/lookup_carpetid"),m=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),a=t.getPointAtLength(r),i=a.x-n.x,o=a.y-n.y,s=Math.sqrt(i*i+o*o);return[i/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,A=k._carpetTrace=g(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,C=k.contours,L=p(C,e,T),P="constraint"===C.type,I=C._operation,z=P?"="===I?"lines":"fill":C.coloring,O=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(L);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(L,D,R);var F,B,N,j,V=L;"constraint"===C.type&&(V=f(L,I)),function(t,e){var r,n,a,i,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=a([],F.x,_.c2p),N=a([],F.y,w.c2p),B.reverse(),N.reverse(),U.push(i(B,N,F.bicubic));var q="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,h,f,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f=0&&(f=C,d=g):Math.abs(h[1]-f[1])=0&&(f=C,d=g):s.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;y+=S(h,f),h=f}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(h,f)+"Z",h=null)}for(u=0;um&&(n.max=m);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*h.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/I),h.LABELMAX),i=0;i0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return a.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":g?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}},{"../../components/color":602,"../../components/colorscale":614,"../../constants/numerical":711,"../../lib":735,"../../lib/geojson_utils":730,"fast-isnumeric":237}],993:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),a(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":612,"../../lib":735,"./attributes":990}],994:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],995:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover");e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=a.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=function(t,e,r){if(t.hovertemplate)return;var a=(e.hi||t.hoverinfo).split("+"),i=-1!==a.indexOf("all"),o=-1!==a.indexOf("lon"),s=-1!==a.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"\xb0"}i||o&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(i||-1!==a.indexOf("text"))&&n.fillText(e,t,c);return c.join("
")}(c,u,l[0].t.labels),[s]}}},{"../../lib":735,"../../plots/cartesian/axes":783,"../scattermapbox/hover":1209}],996:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":838,"./convert":992}],998:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),s.color=function(t,e){var r=t.marker,a=e.mc||r.color,i=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(c,h),[s]}}},{"../../components/color":602,"../../lib":735,"../bar/hover":883}],1006:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../bar/select":888,"./attributes":999,"./calc":1e3,"./cross_trace_calc":1002,"./defaults":1003,"./event_data":1004,"./hover":1005,"./layout_attributes":1007,"./layout_defaults":1008,"./plot":1009,"./style":1010}],1007:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1008:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(a.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":602,"../../components/drawing":624,"../../constants/interactions":710,"../bar/style":890,"../bar/uniform_text":892,d3:165}],1011:[function(t,e,r){"use strict";var n=t("../pie/attributes"),a=t("../../plots/attributes"),i=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":726,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/template_attributes":861,"../pie/attributes":1114}],1012:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1013:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1116}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,a,r,i)}var u=c("labels"),h=c("values"),f=s(u,h),p=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,g=c("text"),m=c("texttemplate");if(m||(d=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),m||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":735,"../../plots/domain":810,"../bar/defaults":880,"../pie/defaults":1117,"./attributes":1011}],1015:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1125,"./attributes":1011,"./base_plot":1012,"./calc":1013,"./defaults":1014,"./layout_attributes":1016,"./layout_defaults":1017,"./plot":1018,"./style":1019}],1016:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1121}],1017:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":735,"./layout_attributes":1016}],1018:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot").toMoveInsideBar,l=t("../bar/uniform_text"),c=l.recordMinTextSize,u=l.clearMinTextSize,h=t("../pie/helpers"),f=t("../pie/plot"),p=f.attachFxHandlers,d=f.determineInsideTextFont,g=f.layoutAreas,m=f.prerenderTitles,v=f.positionTitleOutside,y=f.formatSliceLabel;function x(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;u("funnelarea",r),m(e,t),g(e,r._size),i.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var l=n.select(this),u=e[0],f=u.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var h,f,p=[];for(p.push(u()),h=t.length-1;h>-1;h--)if(!(f=t[h]).hidden){var d=f.v/l;c+=d,p.push(u())}var g=1/0,m=-1/0;for(h=0;h-1;h--)if(!(f=t[h]).hidden){var A=p[k+=1][0],M=p[k][1];f.TL=[-A,M],f.TR=[A,M],f.BL=w,f.BR=T,f.pxmid=(S=f.TR,E=f.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=f.TL,T=f.TR}var S,E}(e),l.each((function(){var l=n.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove(),l.each((function(l,g){if(l.hidden)n.select(this).selectAll("path,g").remove();else{l.pointNumber=l.i,l.curveNumber=f.index;var m=u.cx,v=u.cy,b=n.select(this),_=b.selectAll("path.surface").data([l]);_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),b.call(p,t,e);var w="M"+(m+l.TR[0])+","+(v+l.TR[1])+x(l.TR,l.BR)+x(l.BR,l.BL)+x(l.BL,l.TL)+"Z";_.attr("d",w),y(t,l,u);var T=h.castOption(f.textposition,l.pts),k=b.selectAll("g.slicetext").data(l.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var u=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=i.ensureUniformFontSize(t,d(f,l,r.font));u.text(l.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,h).call(o.convertToTspans,t);var p,y,x,b=a.bBox(u.node()),_=Math.min(l.BL[1],l.BR[1])+v,w=Math.max(l.TL[1],l.TR[1])+v;y=Math.max(l.TL[0],l.BL[0])+m,x=Math.min(l.TR[0],l.BR[0])+m,(p=s(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,c(f.type,p,r),e[g].transform=p,u.attr("transform",i.getTextTransform(p))}))}}));var g=n.select(this).selectAll("g.titletext").data(f.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),s=f.title.text;f._meta&&(s=i.templateString(s,f._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,f.title.font).call(o.convertToTspans,t);var l=v(u,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")}))}))}))}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../bar/plot":887,"../bar/uniform_text":892,"../pie/helpers":1119,"../pie/plot":1123,d3:165}],1019:[function(t,e,r){"use strict";var n=t("d3"),a=t("../pie/style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":892,"../pie/style_one":1125,d3:165}],1020:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../components/colorscale/attributes"),s=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=s({z:{valType:"data_array",editType:"calc"},x:s({},n.x,{impliedEdits:{xtype:"array"}}),x0:s({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:s({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:s({},n.y,{impliedEdits:{ytype:"array"}}),y0:s({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:s({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":609,"../../constants/docs":706,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1021:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),c=t("./clean_2d_array"),u=t("./interp2d"),h=t("./find_empties"),f=t("./make_bound_array"),p=t("../../constants/numerical").BADNUM;function d(t){for(var e=[],r=t.length,n=0;nI){L("x scale is not linear");break}}if(v.length&&"fast"===E){var z=(v[v.length-1]-v[0])/(v.length-1),O=Math.abs(z/100);for(_=0;_O){L("y scale is not linear");break}}}var D=a.maxRowLength(b),R="scaled"===e.xtype?"":r,F=f(e,R,g,m,D,T),B="scaled"===e.ytype?"":v,N=f(e,B,y,x,b.length,k);S||(e._extremes[T._id]=i.findExtremes(T,F),e._extremes[k._id]=i.findExtremes(k,N));var j={x:F,y:N,z:b,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(R&&R.length===F.length-1&&(j.xCenter=R),B&&B.length===N.length-1&&(j.yCenter=B),M&&(j.xRanges=w.xRanges,j.yRanges=w.yRanges,j.pts=w.pts),A||s(t,e,{vals:b,cLetter:"z"}),A&&e.contours&&"heatmap"===e.contours.coloring){var V={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=f(V,R,g,m,D,T),j.yfill=f(V,B,y,x,b.length,k)}return[j]}},{"../../components/colorscale/calc":610,"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"../histogram2d/calc":1052,"./clean_2d_array":1022,"./convert_column_xyz":1024,"./find_empties":1026,"./interp2d":1029,"./make_bound_array":1030}],1022:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,h,f;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,h=0;h=0;o--)(s=((h[[(r=(i=f[o])[0])-1,a=i[1]]]||g)[2]+(h[[r+1,a]]||g)[2]+(h[[r,a-1]]||g)[2]+(h[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in l)h[i]=l[i],u.push(l[i])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":735}],1027:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l,c){var u,h,f,p,d=t.cd[0],g=d.trace,m=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=g.zhoverformat,A=y,M=x;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(c){var S;for(A=[2*y[0]-y[1]],S=1;Sg&&(v=Math.max(v,Math.abs(t[i][o]-d)/(m-g))))}return v}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":735}],1030:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,c,u,h=[],f=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!p&&"category"!==s.type){var g=e.length;if(!(g<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f||d)h=e.slice(0,o);else if(1===o)h=[e[0]-.5,e[0]+.5];else{for(h=[1.5*e[0]-.5*e[1]],u=1;u0;)f=p.c2p(T[y]),y--;for(f0;)v=d.c2p(k[y]),y--;if(v0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]c?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,i,s){if(n&&t>o){var l=d(e,i,s),c=d(r,i,s),u=t===a?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,c=-1.1*e,f=-.1*e,p=t-f,d=r[0],g=r[1],m=Math.min(h(d+f,d+p,n,i),h(g+f,g+p,n,i)),v=Math.min(h(d+c,d+f,n,i),h(g+c,g+f,n,i));if(m>v&&vo){var y=s===a?1:6,x=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,i);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),O.start=r.l2r(j),F||a.nestedProperty(e,v+".start").set(O.start)}var V=b.end,U=r.r2l(z.end),q=void 0!==U;if((b.endFound||q)&&U!==r.r2l(V)){var H=q?U:a.aggNums(Math.max,null,d);O.end=r.l2r(H),q||a.nestedProperty(e,v+".start").set(O.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=a.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[O,d]}e.exports={calc:function(t,e){var r,i,p,d,g=[],m=[],v=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=f(t,e,v,y),T=w[0],k=w[1],A="string"==typeof T.size,M=[],S=A?M:T,E=[],C=[],L=[],P=0,I=e.histnorm,z=e.histfunc,O=-1!==I.indexOf("density");_.enabled&&O&&(I=I.replace(/ ?density$/,""),O=!1);var D,R="max"===z||"min"===z?null:0,F=l.count,B=c[I],N=!1,j=function(t){return v.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==z&&(D=e[x],N="avg"===z,F=l[z]),r=j(T.start),p=j(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(m,_.direction,_.currentbin);var J=Math.min(g.length,m.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(m[r]){$=r;break}for(r=Q;r<=$;r++)if(n(g[r])&&n(m[r])){var tt={p:g[r],s:m[r],b:0};_.enabled||(tt.pts=L[r],G?tt.ph0=tt.ph1=L[r].length?k[L[r][0]]:g[r]:(e._computePh=!0,tt.ph0=q(M[r]),tt.ph1=q(M[r+1],!0))),K.push(tt)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),s(K,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(K,e,Z),K},calcAllAutoBins:f}},{"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"../bar/arrays_to_calcdata":875,"./average":1039,"./bin_functions":1041,"./bin_label_vals":1042,"./norm_functions":1050,"fast-isnumeric":237}],1044:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],1045:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,h,f,p,d,g,m,v=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,i){var o=t.uid+"__"+i;r||(r=o);var s=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),l=t[i+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(i)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[i],axType:s,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],L=[],P="string"==typeof w.size,I="string"==typeof A.size,z=[],O=[],D=P?z:w,R=I?O:A,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),q="max"===V||"min"===V?null:0,H=i.count,G=o[j],Y=!1,W=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==V&&(Y="avg"===V,H=i[V]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-a.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(o.z[h][u]){var f,p=o.hi||s.hoverinfo;if(p){var d=p.split("+");-1!==d.indexOf("all")&&(d=["color"]),-1!==d.indexOf("color")&&(f=!0)}var g,m=s.colormodel,v=m.length,y=s._scaler(o.z[h][u]),x=i.colormodel[m].suffix,b=[];(s.hovertemplate||f)&&(b.push("["+[y[0]+x[0],y[1]+x[1],y[2]+x[2]].join(", ")),4===v&&b.push(", "+y[3]+x[3]),b.push("]"),b=b.join(""),t.extraText=m.toUpperCase()+": "+b),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][u]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][u]);var _=c.c2p(o.y0+(h+.5)*s.dy),w=o.x0+(u+.5)*s.dx,T=o.y0+(h+.5)*s.dy,k="["+o.z[h][u].slice(0,s.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[h,u],x0:l.c2p(o.x0+u*s.dx),x1:l.c2p(o.x0+(u+1)*s.dx),y0:_,y1:_,color:y,xVal:w,xLabelVal:w,yVal:T,yLabelVal:T,zLabelVal:k,text:g,hovertemplateLabels:{zLabel:k,colorLabel:b,"color[0]Label":y[0]+x[0],"color[1]Label":y[1]+x[1],"color[2]Label":y[2]+x[2],"color[3]Label":y[3]+x[3]}})]}}}},{"../../components/fx":642,"../../lib":735,"./constants":1062}],1066:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":796,"./attributes":1060,"./calc":1061,"./defaults":1063,"./event_data":1064,"./hover":1065,"./plot":1067,"./style":1068}],1067:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../constants/xmlns_namespaces"),o=t("./constants");e.exports=function(t,e,r,s){var l=e.xaxis,c=e.yaxis;a.makeTraceGroups(s,r,"im").each((function(t){var e,r,s,u,h,f,p=n.select(this),d=t[0],g=d.trace,m=d.z,v=d.x0,y=d.y0,x=d.w,b=d.h,_=g.dx,w=g.dy;for(f=0;void 0===e&&f0;)r=l.c2p(v+f*_),f--;for(f=0;void 0===u&&f0;)h=c.c2p(y+f*w),f--;r0}function x(t){t.each((function(t){d.stroke(n.select(this),t.line.color)})).each((function(t){d.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function b(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,p,t,e)}return h(i,o,l,s,n),f(i,o,l,s),o}function _(t,e){return"translate("+t+","+e+")"}function w(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function T(t,e,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(c.convertToTspans,a).call(s.font,e),s.bBox(o.node())}function k(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,h){var f,p=t._fullLayout;y(r)&&h&&(f=h()),a.makeTraceGroups(p._indicatorlayer,e,"trace").each((function(e){var h,A,M,S,E,C=e[0].trace,L=n.select(this),P=C._hasGauge,I=C._isAngular,z=C._isBullet,O=C.domain,D={w:p._size.w*(O.x[1]-O.x[0]),h:p._size.h*(O.y[1]-O.y[0]),l:p._size.l+p._size.w*O.x[0],r:p._size.r+p._size.w*(1-O.x[1]),t:p._size.t+p._size.h*(1-O.y[1]),b:p._size.b+p._size.h*O.y[0]},R=D.l+D.w/2,F=D.t+D.h/2,B=Math.min(D.w/2,D.h),N=l.innerRadius*B,j=C.align||"center";if(A=F,P){if(I&&(h=R,A=F+B/2,M=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*N)}),z){var V=l.bulletPadding,U=1-l.bulletNumberDomainSize+V;h=D.l+(U+(1-U)*m[j])*D.w,M=function(t){return w(t,(l.bulletNumberDomainSize-V)*D.w,D.h)}}}else h=D.l+m[j]*D.w,M=function(t){return w(t,D.w,D.h)};!function(t,e,r,i){var o,l,h,f=r[0].trace,p=i.numbersX,x=i.numbersY,w=f.align||"center",A=g[w],M=i.transitionOpts,S=i.onComplete,E=a.ensureSingle(e,"g","numbers"),C=[];f._hasNumber&&C.push("number");f._hasDelta&&(C.push("delta"),"left"===f.delta.position&&C.reverse());var L=E.selectAll("text").data(C);function P(e,r,n,a){if(!e.match("s")||n>=0==a>=0||r(n).slice(-1).match(v)||r(a).slice(-1).match(v))return r;var i=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=b(t,{tickformat:i});return function(t){return Math.abs(t)<1?u.tickText(o,t).text:r(t)}}L.enter().append("text"),L.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),L.exit().remove();var I,z=f.mode+f.align;f._hasDelta&&(I=function(){var e=b(t,{tickformat:f.delta.valueformat},f._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=function(t){return f.delta.relative?t.relativeDelta:t.delta},o=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?f.delta.increasing.symbol:f.delta.decreasing.symbol)+e(t)},h=function(t){return t.delta>=0?f.delta.increasing.color:f.delta.decreasing.color};void 0===f._deltaLastValue&&(f._deltaLastValue=i(r[0]));var p=E.select("text.delta");function g(){p.text(o(i(r[0]),a)).call(d.fill,h(r[0])).call(c.convertToTspans,t)}return p.call(s.font,f.delta.font).call(d.fill,h({delta:f._deltaLastValue})),y(M)?p.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=n.select(this),e=i(r[0]),s=f._deltaLastValue,l=P(f.delta.valueformat,a,s,e),c=n.interpolateNumber(s,e);return f._deltaLastValue=e,function(e){t.text(o(c(e),l)),t.call(d.fill,h({delta:c(e)}))}})).each("end",(function(){g(),S&&S()})).each("interrupt",(function(){g(),S&&S()})):g(),l=T(o(i(r[0]),a),f.delta.font,A,t),p}(),z+=f.delta.position+f.delta.font.size+f.delta.font.family+f.delta.valueformat,z+=f.delta.increasing.symbol+f.delta.decreasing.symbol,h=l);f._hasNumber&&(!function(){var e=b(t,{tickformat:f.number.valueformat},f._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=f.number.suffix,l=f.number.prefix,h=E.select("text.number");function p(){var e="number"==typeof r[0].y?l+a(r[0].y)+i:"-";h.text(e).call(s.font,f.number.font).call(c.convertToTspans,t)}y(M)?h.transition().duration(M.duration).ease(M.easing).each("end",(function(){p(),S&&S()})).each("interrupt",(function(){p(),S&&S()})).attrTween("text",(function(){var t=n.select(this),e=n.interpolateNumber(r[0].lastY,r[0].y);f._lastValue=r[0].y;var o=P(f.number.valueformat,a,r[0].lastY,r[0].y);return function(r){t.text(l+o(e(r))+i)}})):p(),o=T(l+a(r[0].y)+i,f.number.font,A,t)}(),z+=f.number.font.size+f.number.font.family+f.number.valueformat+f.number.suffix+f.number.prefix,h=o);if(f._hasDelta&&f._hasNumber){var O,D,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(l.left+l.right)/2,(l.top+l.bottom)/2],B=.75*f.delta.font.size;"left"===f.delta.position&&(O=k(f,"deltaPos",0,-1*(o.width*m[f.align]+l.width*(1-m[f.align])+B),z,Math.min),D=R[1]-F[1],h={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:l.left+O,right:o.right,top:Math.min(o.top,l.top+D),bottom:Math.max(o.bottom,l.bottom+D)}),"right"===f.delta.position&&(O=k(f,"deltaPos",0,o.width*(1-m[f.align])+l.width*m[f.align]+B,z,Math.max),D=R[1]-F[1],h={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:o.left,right:l.right+O,top:Math.min(o.top,l.top+D),bottom:Math.max(o.bottom,l.bottom+D)}),"bottom"===f.delta.position&&(O=null,D=l.height,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height,bottom:o.bottom+l.height}),"top"===f.delta.position&&(O=null,D=o.top,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height-l.height,bottom:o.bottom}),I.attr({dx:O,dy:D})}(f._hasNumber||f._hasDelta)&&E.attr("transform",(function(){var t=i.numbersScaler(h);z+=t[2];var e,r=k(f,"numbersScale",1,t[0],z,Math.min);f._scaleNumbers||(r=1),e=f._isAngular?x-r*h.bottom:x-r*(h.top+h.bottom)/2,f._numbersTop=r*h.top+e;var n=h[w];"center"===w&&(n=(h.left+h.right)/2);var a=p-r*n;return _(a=k(f,"numbersTranslate",0,a,z,Math.max),e)+" scale("+r+")"}))}(t,L,e,{numbersX:h,numbersY:A,numbersScaler:M,transitionOpts:r,onComplete:f}),P&&(S={range:C.gauge.axis.range,color:C.gauge.bgcolor,line:{color:C.gauge.bordercolor,width:0},thickness:1},E={range:C.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:C.gauge.bordercolor,width:C.gauge.borderwidth},thickness:1});var q=L.selectAll("g.angular").data(I?e:[]);q.exit().remove();var H=L.selectAll("g.angularaxis").data(I?e:[]);H.exit().remove(),I&&function(t,e,r,a){var s,l,c,h,f=r[0].trace,p=a.size,d=a.radius,g=a.innerRadius,m=a.gaugeBg,v=a.gaugeOutline,w=[p.l+p.w/2,p.t+p.h/2+d/2],T=a.gauge,k=a.layer,A=a.transitionOpts,M=a.onComplete,S=Math.PI/2;function E(t){var e=f.gauge.axis.range[0],r=(t-e)/(f.gauge.axis.range[1]-e)*Math.PI-S;return r<-S?-S:r>S?S:r}function C(t){return n.svg.arc().innerRadius((g+d)/2-t/2*(d-g)).outerRadius((g+d)/2+t/2*(d-g)).startAngle(-S)}function L(t){t.attr("d",(function(t){return C(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}T.enter().append("g").classed("angular",!0),T.attr("transform",_(w[0],w[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(s=b(t,f.gauge.axis)).type="linear",s.range=f.gauge.axis.range,s._id="xangularaxis",s.setScale();var P=function(t){return(s.range[0]-t.x)/(s.range[1]-s.range[0])*Math.PI+Math.PI},I={},z=u.makeLabelFns(s,0).labelStandoff;I.xFn=function(t){var e=P(t);return Math.cos(e)*z},I.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*o)},I.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return _(w[0]+d*Math.cos(t),w[1]-d*Math.sin(t))};c=function(t){return O(P(t))};if(l=u.calcTicks(s),h=u.getTickSigns(s)[2],s.visible){h="inside"===s.ticks?-1:1;var D=(s.linewidth||1)/2;u.drawTicks(t,s,{vals:l,layer:k,path:"M"+h*D+",0h"+h*s.ticklen,transFn:function(t){var e=P(t);return O(e)+"rotate("+-i(e)+")"}}),u.drawLabels(t,s,{vals:l,layer:k,transFn:c,labelFns:I})}var R=[m].concat(f.gauge.steps),F=T.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(L).call(x),F.exit().remove();var B=C(f.gauge.bar.thickness),N=T.selectAll("g.value-arc").data([f.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var j=N.select("path");y(A)?(j.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(V=B,U=E(r[0].lastY),q=E(r[0].y),function(){var t=n.interpolate(U,q);return function(e){return V.endAngle(t(e))()}})),f._lastValue=r[0].y):j.attr("d","number"==typeof r[0].y?B.endAngle(E(r[0].y)):"M0,0Z");var V,U,q;j.call(x),N.exit().remove(),R=[];var H=f.gauge.threshold.value;H&&R.push({range:[H,H],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var G=T.selectAll("g.threshold-arc").data(R);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(L).call(x),G.exit().remove();var Y=T.selectAll("g.gauge-outline").data([v]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(x),Y.exit().remove()}(t,0,e,{radius:B,innerRadius:N,gauge:q,layer:H,size:D,gaugeBg:S,gaugeOutline:E,transitionOpts:r,onComplete:f});var G=L.selectAll("g.bullet").data(z?e:[]);G.exit().remove();var Y=L.selectAll("g.bulletaxis").data(z?e:[]);Y.exit().remove(),z&&function(t,e,r,n){var a,i,o,s,c,h=r[0].trace,f=n.gauge,p=n.layer,g=n.gaugeBg,m=n.gaugeOutline,v=n.size,_=h.domain,w=n.transitionOpts,T=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform","translate("+v.l+", "+v.t+")"),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=v.h,A=h.gauge.bar.thickness*k,M=_.x[0],S=_.x[0]+(_.x[1]-_.x[0])*(h._hasNumber||h._hasDelta?1-l.bulletNumberDomainSize:1);(a=b(t,h.gauge.axis))._id="xbulletaxis",a.domain=[M,S],a.setScale(),i=u.calcTicks(a),o=u.makeTransFn(a),s=u.getTickSigns(a)[2],c=v.t+v.h,a.visible&&(u.drawTicks(t,a,{vals:"inside"===a.ticks?u.clipEnds(a,i):i,layer:p,path:u.makeTickPath(a,c,s),transFn:o}),u.drawLabels(t,a,{vals:i,layer:p,transFn:o,labelFns:u.makeLabelFns(a,c)}));function E(t){t.attr("width",(function(t){return Math.max(0,a.c2p(t.range[1])-a.c2p(t.range[0]))})).attr("x",(function(t){return a.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*k})).attr("height",(function(t){return t.thickness*k}))}var C=[g].concat(h.gauge.steps),L=f.selectAll("g.bg-bullet").data(C);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(E).call(x),L.exit().remove();var P=f.selectAll("g.value-bullet").data([h.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(x),y(w)?P.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){T&&T()})).each("interrupt",(function(){T&&T()})).attr("width",Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return h.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(I);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",a.c2p(h.gauge.threshold.value)).attr("x2",a.c2p(h.gauge.threshold.value)).attr("y1",(1-h.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-h.gauge.threshold.thickness)/2)*k).call(d.stroke,h.gauge.threshold.line.color).style("stroke-width",h.gauge.threshold.line.width),z.exit().remove();var O=f.selectAll("g.gauge-outline").data([m]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(E).call(x),O.exit().remove()}(t,0,e,{gauge:G,layer:Y,size:D,gaugeBg:S,gaugeOutline:E,transitionOpts:r,onComplete:f});var W=L.selectAll("text.title").data(e);W.exit().remove(),W.enter().append("text").classed("title",!0),W.attr("text-anchor",(function(){return z?g.right:g[C.title.align]})).text(C.title.text).call(s.font,C.title.font).call(c.convertToTspans,t),W.attr("transform",(function(){var t,e=D.l+D.w*m[C.title.align],r=l.titlePadding,n=s.bBox(W.node());if(P){if(I)if(C.gauge.axis.visible)t=s.bBox(H.node()).top-r-n.bottom;else t=D.t+D.h/2-B/2-n.bottom-r;z&&(t=A-(n.top+n.bottom)/2,e=D.l-l.bulletPadding*D.w)}else t=C._numbersTop-r-n.bottom;return _(e,t)}))}))}},{"../../components/color":602,"../../components/drawing":624,"../../constants/alignment":704,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../plots/cartesian/axis_defaults":785,"../../plots/cartesian/layout_attributes":797,"../../plots/cartesian/position_defaults":800,"./constants":1072,d3:165}],1076:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;var c=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plots/attributes":780,"../../plots/template_attributes":861,"../mesh3d/attributes":1081}],1077:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../streamtube/calc").processGrid,i=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var r=a(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),a=Math.max(e[r],e[r-1]);if(a>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){L();var a,i,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],a=t[2],i=function(t,e,r){for(var n=[],a=0;a-1?n[p]:C(d,g,v);f[p]=x>-1?x:I(d,g,v,R(e,y))}a=f[0],i=f[1],o=f[2],t._meshI.push(a),t._meshJ.push(i),t._meshK.push(o),++m}}function B(t,e,r,n){var a=t[3];an&&(a=n);for(var i=(t[3]-a)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*t[s]+i*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function V(e){for(var r=[],n=0;n<4;n++){var a=e[n];r.push([t._x[a],t._y[a],t._z[a],t._value[a]])}return r}function U(t,e,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,a),N(e[1][3],n,a),N(e[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):i<3&&U(t,e,r,S,E,++i)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var u=e[i[0]],h=e[i[1]],f=e[i[2]],p=B(f,u,n,a),d=B(f,h,n,a);o=l(t,[d,p,u],[-1,-1,r[i[0]]])||o,o=l(t,[u,h,d],[r[i[0]],r[i[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var u=e[i[0]],h=e[i[1]],f=e[i[2]],p=B(h,u,n,a),d=B(f,u,n,a);o=l(t,[d,p,u],[-1,-1,r[i[0]]])||o,c=!0}})),o}function q(t,e,r,n){var a=!1,i=V(e),o=[N(i[0][3],r,n),N(i[1][3],r,n),N(i[2][3],r,n),N(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(a=function(t,e,r){var n=function(n,a,i){F(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,i,e)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]];if(g)a=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||a;else{var p=B(f,c,r,n),d=B(f,u,r,n),m=B(f,h,r,n);a=F(null,[p,d,m],[-1,-1,-1])||a}s=!0}})),s?a:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]],p=B(h,c,r,n),d=B(h,u,r,n),m=B(f,u,r,n),v=B(f,c,r,n);g?(a=F(t,[c,v,p],[e[l[0]],-1,-1])||a,a=F(t,[u,d,m],[e[l[1]],-1,-1])||a):a=function(t,e,r){var n=function(n,a,i){F(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(2,3,0)}(null,[p,d,m,v],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]],p=B(u,c,r,n),d=B(h,c,r,n),m=B(f,c,r,n);g?(a=F(t,[c,p,d],[e[l[0]],-1,-1])||a,a=F(t,[c,d,m],[e[l[0]],-1,-1])||a,a=F(t,[c,m,p],[e[l[0]],-1,-1])||a):a=F(null,[p,d,m],[-1,-1,-1])||a,s=!0}})),a)}function H(t,e,r,n,a,i,o,s,l,c,u){var h=!1;return d&&(D(t,"A")&&(h=q(null,[e,r,n,i],c,u)||h),D(t,"B")&&(h=q(null,[r,n,a,l],c,u)||h),D(t,"C")&&(h=q(null,[r,i,o,l],c,u)||h),D(t,"D")&&(h=q(null,[n,i,s,l],c,u)||h),D(t,"E")&&(h=q(null,[r,n,i,l],c,u)||h)),g&&(h=q(t,[r,n,i,l],c,u)||h),h}function G(t,e,r,n,a,i,o,s){return[!0===s[0]||U(t,V([e,r,n]),[e,r,n],i,o),!0===s[1]||U(t,V([n,a,e]),[n,a,e],i,o)]}function Y(t,e,r,n,a,i,o,s,l){return s?G(t,e,r,a,n,i,o,l):G(t,r,a,n,e,i,o,l)}function W(t,e,r,n,a,i,o){var s,l,c,u,h=!1,f=function(){h=U(t,[s,l,c],[-1,-1,-1],a,i)||h,h=U(t,[c,u,s],[-1,-1,-1],a,i)||h},p=o[0],d=o[1],g=o[2];return p&&(s=z(V([k(e,r-0,n-0)])[0],V([k(e-1,r-0,n-0)])[0],p),l=z(V([k(e,r-0,n-1)])[0],V([k(e-1,r-0,n-1)])[0],p),c=z(V([k(e,r-1,n-1)])[0],V([k(e-1,r-1,n-1)])[0],p),u=z(V([k(e,r-1,n-0)])[0],V([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=z(V([k(e-0,r,n-0)])[0],V([k(e-0,r-1,n-0)])[0],d),l=z(V([k(e-0,r,n-1)])[0],V([k(e-0,r-1,n-1)])[0],d),c=z(V([k(e-1,r,n-1)])[0],V([k(e-1,r-1,n-1)])[0],d),u=z(V([k(e-1,r,n-0)])[0],V([k(e-1,r-1,n-0)])[0],d),f()),g&&(s=z(V([k(e-0,r-0,n)])[0],V([k(e-0,r-0,n-1)])[0],g),l=z(V([k(e-0,r-1,n)])[0],V([k(e-0,r-1,n-1)])[0],g),c=z(V([k(e-1,r-1,n)])[0],V([k(e-1,r-1,n-1)])[0],g),u=z(V([k(e-1,r-0,n)])[0],V([k(e-1,r-0,n-1)])[0],g),f()),h}function Z(t,e,r,n,a,i,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),H(f,e,r,n,a,i,o,s,l,c,u)):(d&&"odd"===t&&(f=null),H(f,l,s,o,i,a,n,r,e,c,u))}function X(t,e,r,n,a){for(var i=[],o=0,s=0;sMath.abs(d-M)?[A,d]:[d,M];$(e,T[0],T[1])}}var C=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?h.push([p.distRatio,0,0]):"y"===e?h.push([0,p.distRatio,0]):h.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[a]="x"===e?tt(null,u,i,o,h,r[a]):"y"===e?et(null,u,i,o,h,r[a]):rt(null,u,i,o,h,r[a]),a++),c.length>0&&(r[a]="x"===e?X(null,c,i,o,r[a]):"y"===e?J(null,c,i,o,r[a]):K(null,c,i,o,r[a]),a++)}var d=t.caps[e];d.show&&d.fill&&(O(d.fill),r[a]="x"===e?X(null,[0,b-1],i,o,r[a]):"y"===e?J(null,[0,_-1],i,o,r[a]):K(null,[0,w-1],i,o,r[a]),a++)}})),0===m&&P(),t._meshX=n,t._meshY=a,t._meshZ=i,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new c(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":614,"../../lib/gl_format_color":732,"../../lib/str2rgbarray":758,"../../plots/gl3d/zip3":836,"gl-mesh3d":291}],1079:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=i("x"),u=i("y"),h=i("z"),f=i("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){var e="caps."+t;i(e+".show")&&i(e+".fill");var r="slices."+t;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){i(t)})),o(t,e,n,i,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,a){s(t,e,r,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":612,"../../lib":735,"../../registry":866,"./attributes":1076}],1080:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":825,"./attributes":1076,"./calc":1077,"./convert":1078,"./defaults":1079}],1081:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:s({},i.lightposition.x,{dflt:1e5}),y:s({},i.lightposition.y,{dflt:1e5}),z:s({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},i.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../surface/attributes":1263}],1082:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":610}],1083:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),a=t("delaunay-triangulate"),i=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,h=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!m(t.i,h)||!m(t.j,h)||!m(t.k,h))return;n=u(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(f):t.alphahull>0?i(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;om):g=T>b,m=T;var k=l(b,_,w,T);k.pos=x,k.yc=(b+T)/2,k.i=y,k.dir=g?"increasing":"decreasing",k.x=k.pos,k.y=[w,_],p&&(k.tx=e.text[y]),d&&(k.htx=e.hovertext[y]),v.push(k)}else v.push({pos:x,empty:!0})}return e._extremes[s._id]=i.findExtremes(s,n.concat(h,u),{padded:!0}),v.length&&(v[0].t={labels:{open:a(t,"open:")+" ",high:a(t,"high:")+" ",low:a(t,"low:")+" ",close:a(t,"close:")+" "}}),v}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis),a=i.getFromId(t,e.yaxis),o=function(t,e,r){var a=r._minDiff;if(!a){var i,o=t._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(s,b):((y=a.extendFlat({},f)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b),y.name="",h.push(y),m[b]=y)}return h}function f(t,e,r,a){var i=t.cd,o=t.ya,l=i[0].trace,h=i[0].t,f=u(t,e,r,a);if(!f)return[];var p=i[f.index],d=f.index=p.i,g=p.dir;function m(t){return h.labels[t]+n.hoverLabelText(o,l[t][d])}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[m("open"),m("high"),m("low"),m("close")+" "+c[g]]:[];return _&&s(p,l,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?h(t,e,r,n):f(t,e,r,n)},hoverSplit:h,hoverOnPoints:f}},{"../../components/color":602,"../../components/fx":642,"../../constants/delta.js":705,"../../lib":735,"../../plots/cartesian/axes":783}],1090:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":796,"./attributes":1086,"./calc":1087,"./defaults":1088,"./hover":1089,"./plot":1092,"./select":1093,"./style":1094}],1091:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,a.minRowLength(o))),e._length=h,h}}},{"../../lib":735,"../../registry":866}],1092:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");e.exports=function(t,e,r,i){var o=e.xaxis,s=e.yaxis;a.makeTraceGroups(i,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],i=r.t;if(!0!==r.trace.visible||i.empty)e.remove();else{var l=i.tickLen,c=e.selectAll("path").data(a.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-l,!0),n=o.c2p(t.pos+l,!0);return"M"+r+","+s.c2p(t.o,!0)+"H"+e+"M"+e+","+s.c2p(t.h,!0)+"V"+s.c2p(t.l,!0)+"M"+n+","+s.c2p(t.c,!0)+"H"+e}))}}))}},{"../../lib":735,d3:165}],1093:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,h){function f(r,a){return n.coerce(t,e,l,r,a)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,h,f);o(e,h,f),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var g={family:h.font.family,size:Math.round(h.font.size),color:h.font.color};n.coerceFont(f,"labelfont",g);var m={family:h.font.family,size:Math.round(h.font.size/1.2),color:h.font.color};n.coerceFont(f,"tickfont",m)}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735,"../../plots/array_container_defaults":779,"../../plots/domain":810,"../parcoords/merge_length":1111,"./attributes":1095}],1099:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1095,"./base_plot":1096,"./calc":1097,"./defaults":1098,"./plot":1101}],1100:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plot_api/plot_api"),i=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),c=t("../../lib/svg_text_utils");function u(t,e,r,a){var i=t.map(D.bind(0,e,r)),l=a.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=l.selectAll("g.trace.parcats").data(i,h),m=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"})),m.append("g").attr("class","paths");var v=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);v.attr("fill",(function(t){return t.model.color}));var b=v.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);x(b),v.attr("d",(function(t){return t.svgD})),b.empty()||v.sort(p),v.exit().remove(),v.on("mouseover",d).on("mouseout",g).on("click",y),m.append("g").attr("class","dimensions");var T=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);T.enter().append("g").attr("class","dimension"),T.attr("transform",(function(t){return"translate("+t.x+", 0)"})),T.exit().remove();var k=T.selectAll("g.category").data((function(t){return t.categories}),h),A=k.enter().append("g").attr("class","category");k.attr("transform",(function(t){return"translate(0, "+t.y+")"})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),k.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),_(A);var M=k.selectAll("rect.bandrect").data((function(t){return t.bands}),h);M.each((function(){o.raiseToTop(this)})),M.attr("fill",(function(t){return t.color}));var I=M.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);M.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),w(I),M.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var z=e._fullLayout.paper_bgcolor;k.select("text.catlabel").attr("text-anchor",(function(t){return f(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",z+" -1px 1px 2px, "+z+" 1px 1px 2px, "+z+" 1px -1px 2px, "+z+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",(function(t){return f(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),c.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),k.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){s.font(n.select(this),t.parcatsViewModel.labelfont)})),k.selectAll("rect.bandrect").on("mouseover",S).on("mouseout",E),k.exit().remove(),T.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",L).on("dragend",P)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function h(t){return t.key}function f(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function p(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),C=n.mouse(h)[0];i.loneHover({trace:f,x:_-d.left+g.left,y:w-d.top+g.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:C<_?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:f._input,fullData:f,count:k,probability:A}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:h})}}}function g(t){if(!t.parcatsViewModel.dragDimension&&(x(n.select(this)),i.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(p),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=m(t),r=v(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:n.event,constraints:r})}}function m(t){for(var e=[],r=I(t.parcatsViewModel),n=0;n1&&c.displayInd===l.dimensions.length-1?(r=o.left,a="left"):(r=o.left+o.width,a="right");var f=s.model.count,p=s.model.categoryLabel,d=f/s.parcatsViewModel.model.count,g={countLabel:f,categoryLabel:p,probabilityLabel:d.toFixed(3)},m=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&m.push(["Count:",g.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&m.push(["P("+g.categoryLabel+"):",g.probabilityLabel].join(" "));var v=m.join("
");return{trace:u,x:r-t.left,y:h-t.top,text:v,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:u.hovertemplate,hovertemplateLabels:g,eventData:[{data:u._input,fullData:u,count:f,category:p,probability:d}]}}function S(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,a=r._fullLayout,s=a._paperdiv.node().getBoundingClientRect(),c=t.parcatsViewModel.hoveron;if("color"===c?(!function(t){var e=n.select(t).datum(),r=T(e);b(r),r.each((function(){o.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),A(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=T(t);b(e),e.each((function(){o.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),k(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===c?e=M(s,this):"color"===c?e=function(t,e){var r,a,i=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,c=s.parcatsViewModel,u=c.model.dimensions[s.model.dimensionInd],h=c.trace,f=i.y+i.height/2;c.dimensions.length>1&&u.displayInd===c.dimensions.length-1?(r=i.left,a="left"):(r=i.left+i.width,a="right");var p=s.model.categoryLabel,d=o.parcatsViewModel.model.count,g=0;o.categoryViewModel.bands.forEach((function(t){t.color===o.color&&(g+=t.count)}));var m=s.model.count,v=0;c.pathSelection.each((function(t){t.model.color===o.color&&(v+=t.model.count)}));var y=g/d,x=g/v,b=g/m,_={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",_.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color \u2229 "+p+"): "+_.probabilityLabel),w.push("P("+p+" | color): "+x.toFixed(3)),w.push("P(color | "+p+"): "+b.toFixed(3)));var T=w.join("
"),k=l.mostReadable(o.color,["black","white"]);return{trace:h,x:r-t.left,y:f-t.top,text:T,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:k,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:_,eventData:[{data:h._input,fullData:h,category:p,count:d,probability:y,categorycount:m,colorcount:v,bandcolorcount:g}]}}(s,this):"dimension"===c&&(e=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){r.push(M(t,this))})),r}(s,this)),e&&i.loneHover(e,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r})}}function E(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(x(e.pathSelection),_(e.dimensionSelection.selectAll("g.category")),w(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),i.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(p),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?A(this,"plotly_unhover",n.event):k(this,"plotly_unhover",n.event)}}function C(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],a=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=a&&a<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){i.model.dragX=n.event.x;var f=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[a];void 0!==f&&i.model.dragXp.x&&(i.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=i.model.displayInd}B(t.parcatsViewModel),F(t.parcatsViewModel),O(t.parcatsViewModel),z(t.parcatsViewModel)}}function P(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=I(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var a=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+a+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?A(t.potentialClickBand,"plotly_click",n.event.sourceEvent):k(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,B(t.parcatsViewModel),F(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){O(t.parcatsViewModel,!0),z(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function I(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+a)+" "+l[s]+","+(e[s]+a)+" "+(t[s]+r[s])+","+(e[s]+a),u+="l-"+r[s]+",0 ";return u+="Z"}function F(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),a=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),i=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return a[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),a=h(r);return"backward"===t.sortpaths&&(n.reverse(),a.reverse()),n.push(e.valueInds[0]),a.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),a.unshift(r.rawColor)),na?1:0}));for(var f=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),g=0;g0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*a;var i,o,s,l,c,u=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),g=8*(h-f)/2,m=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(m.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:i,y:null!==o.dragY?o.dragY:g,bands:[],parcatsViewModel:t},g=g+i+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){u(r,t,n,e)}},{"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/svg_text_utils":759,"../../plot_api/plot_api":770,d3:165,tinycolor2:535}],1101:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,a){var i=t._fullLayout,o=i._paper,s=i._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,a)}},{"./parcats":1100}],1102:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/plot_template":773,"../../plots/cartesian/layout_attributes":797,"../../plots/domain":810,"../../plots/font_attributes":811}],1103:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function c(t,e){return t*(1-l)+e*l}var u=n.bar.snapClose;function h(t,e){return t*(1-u)+e*u}function f(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],u=l,f=i;a*fe){f=r;break}}if(i=u,isNaN(i)&&(i=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);g&&(o.interval=l[i],o.intervalPix=d,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function _(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),x(t.parentNode)}function w(t,e){var r=b(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function T(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||v()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=b(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){_(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),_(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,v(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&A(r)):A(r),i.brushCallback(e),x(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(c?[i.newExtent]:[]),i.extent.length||A(r),i.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(T).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(y);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?M(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[f(0,r,t[0],[]),f(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":735,"../../lib/gup":733,"./constants":1106,d3:165}],1104:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":712,"../../plots/get_data":820,"./plot":1113,d3:165}],1105:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rh&&(n.log("parcoords traces support up to "+h+" dimensions at the moment"),d.splice(h));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),m=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),f(e,g,"values",m);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735,"../../plots/array_container_defaults":779,"../../plots/cartesian/axes":783,"../../plots/domain":810,"./attributes":1102,"./axisbrush":1103,"./constants":1106,"./merge_length":1111}],1108:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":735}],1109:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1102,"./base_plot":1104,"./calc":1105,"./defaults":1107,"./plot":1113}],1110:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function f(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*c,i.offset=2*l*n,e(i),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;iu&&(u=t[a].dim1.canvasX,o=a);0===s&&h(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(S=S.slice(0,a._length));var E,C=a.tickvals;function L(t,e){return{val:t,text:E[e]}}function P(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){E=a.ticktext,Array.isArray(E)&&E.length?E.length>C.length?E=E.slice(0,C.length):C.length>E.length&&(C=C.slice(0,E.length)):E=C.map(n.format(a.tickformat));for(var I=1;I=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==O&&(u?a.hover(f):a.unhover&&a.unhover(f),O=h)}})),z.style("opacity",(function(t){return t.pick?0:1})),u.style("background","rgba(255, 255, 255, 0)");var D=u.selectAll("."+g.cn.parcoords).data(k,h);D.exit().remove(),D.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),D.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var R=D.selectAll("."+g.cn.parcoordsControlView).data(f,h);R.enter().append("g").classed(g.cn.parcoordsControlView,!0),R.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var F=R.selectAll("."+g.cn.yAxis).data((function(t){return t.dimensions}),h);F.enter().append("g").classed(g.cn.yAxis,!0),R.each((function(t){L(F,t)})),z.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=v(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),F.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),F.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;T.linePickActive(!1),t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,F.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),L(F,e),F.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),F.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,L(F,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),T.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),F.exit().remove();var B=F.selectAll("."+g.cn.axisOverlays).data(f,h);B.enter().append("g").classed(g.cn.axisOverlays,!0),B.selectAll("."+g.cn.axis).remove();var N=B.selectAll("."+g.cn.axis).data(f,h);N.enter().append("g").classed(g.cn.axis,!0),N.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return d.isOrdinal(t)?e:P(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(N.selectAll("text"),t.model.tickFont)})),N.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),N.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=B.selectAll("."+g.cn.axisHeading).data(f,h);j.enter().append("g").classed(g.cn.axisHeading,!0);var V=j.selectAll("."+g.cn.axisTitle).data(f,h);V.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),V.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=C(t.model.labelAngle,t.model.labelSide),r=g.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=C(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var U=B.selectAll("."+g.cn.axisExtent).data(f,h);U.enter().append("g").classed(g.cn.axisExtent,!0);var q=U.selectAll("."+g.cn.axisExtentTop).data(f,h);q.enter().append("g").classed(g.cn.axisExtentTop,!0),q.attr("transform","translate(0,"+-g.axisExtentOffset+")");var H=q.selectAll("."+g.cn.axisExtentTopText).data(f,h);H.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(E),H.text((function(t){return I(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var G=U.selectAll("."+g.cn.axisExtentBottom).data(f,h);G.enter().append("g").classed(g.cn.axisExtentBottom,!0),G.attr("transform",(function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"}));var Y=G.selectAll("."+g.cn.axisExtentBottomText).data(f,h);Y.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(E),Y.text((function(t){return I(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),m.ensureAxisBrush(B)}},{"../../components/colorscale":614,"../../components/drawing":624,"../../lib":735,"../../lib/gup":733,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"./axisbrush":1103,"./constants":1106,"./helpers":1108,"./lines":1110,"color-rgba":124,d3:165}],1113:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},c={},u={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;c[r]=n.index;var a=u[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",h=r._tracePreGUI[t._fullData[c[e]]._fullInput.uid];if(void 0===h[s]){var f=i.constraintrange;h[s]=f||null}var p=t._fullData[c[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[u[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[u[e]]])}})}}},{"../../lib/prepare_regl":748,"./helpers":1108,"./parcoords":1112}],1114:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":601,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/font_attributes":811,"../../plots/template_attributes":861}],1115:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1116:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=a(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=l(c("labels"),c("values")),h=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),d=c("texttemplate");if(d||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||f&&"none"!==f){var g=c("textposition");s(t,e,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(e,n,c);var m=c("hole");if(c("title.text")){var v=c("title.position",m?"middle center":"top center");m||"middle center"!==v||(e.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":735,"../../plots/domain":810,"../bar/defaults":880,"./attributes":1114,"fast-isnumeric":237}],1118:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":638}],1119:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:u.hovertemplate||-1!==h.indexOf("name")?u.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:d.castOption(b.bgcolor,t.pts)||t.color,borderColor:d.castOption(b.bordercolor,t.pts),fontFamily:d.castOption(_.family,t.pts),fontSize:d.castOption(_.size,t.pts),fontColor:d.castOption(_.color,t.pts),nameLength:d.castOption(b.namelength,t.pts),textAlign:d.castOption(b.align,t.pts),hovertemplate:d.castOption(u.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,u)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[g(s,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[g(t,a)],i.click(e,n.event))}))}function y(t,e,r){var n=d.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=d.castOption(t._input.textfont.color,e.pts));var a=d.castOption(t.insidetextfont.family,e.pts)||d.castOption(t.textfont.family,e.pts)||r.family,i=d.castOption(t.insidetextfont.size,e.pts)||d.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function x(t,e){for(var r,n,a=0;ae&&e>n||r=-4;m-=2)v(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)v(Math.PI*(m+1),"tan")}if(h||p){for(m=4;m>=-4;m-=2)v(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)v(Math.PI*(m+.5),"rad")}}if(s||d||h){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,i.scale>=1)return i;g.push(i)}(d||p)&&((i=_(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i)),(d||f)&&((i=w(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(t,e,r,n,a){e=Math.max(0,e-2*p);var i=t.width/t.height,o=A(i,n,e,r);return{scale:2*o/t.height,rCenter:T(i,o/e),rotate:k(a)}}function w(t,e,r,n,a){e=Math.max(0,e-2*p);var i=t.height/t.width,o=A(i,n,e,r);return{scale:2*o/t.width,rCenter:T(i,o/e),rotate:k(a+Math.PI/2)}}function T(t,e){return Math.cos(e)-t*e}function k(t){return(180/Math.PI*t+720)%180-90}function A(t,e,r,n){var a=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}function M(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function S(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function E(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=i.title.font.size,a=L(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,s.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(h+=u,o.x-=(1+a)*u,s.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?h*=2:-1!==i.title.position.indexOf("right")&&(h+=u,o.x+=(1+a)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=C(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function C(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function L(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function P(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(i){var x=l.castOption(a,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:d.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:d.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(a,t.i,"customdata")}}(e),_=d.getFirstFilled(a.text,e.pts);(m(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function O(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=i*n-o*a,t.textY=i*a+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;f("pie",r),x(e,t),P(e,i);var u=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var u=n.select(this),f=e[0],p=f.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,s=o.rotation*Math.PI/180,l=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ea.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=M(r,a))}(e),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var m=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,m[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=f.cx,u=f.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(v,t,e),p.pull){var w=+d.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===f.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+L(a.px0,a.pxmid,!0,1)+L(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+L(a.px0,a.pxmid,!1,T)+L(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var A=L(a.px0,a.px1,!0,1);if(T){var M=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+L(a.px1,a.px0,!1,T)+"l"+M*a.px0[0]+","+M*a.px0[1]+A+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(t,a,f);var E=d.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==E?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),m=l.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=d.castOption(t.outsidetextfont.color,e.pts)||d.castOption(t.textfont.color,e.pts)||r.color,a=d.castOption(t.outsidetextfont.family,e.pts)||d.castOption(t.textfont.family,e.pts)||r.family,i=d.castOption(t.outsidetextfont.size,e.pts)||d.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,m).call(c.convertToTspans,t);var v,_=s.bBox(g.node());if("outside"===E)v=S(_,a);else if(v=b(_,a,f),"auto"===E&&v.scale<1){var w=l.ensureUniformFontSize(t,p.outsidetextfont);g.call(s.font,w),v=S(_=s.bBox(g.node()),a)}var T=v.textPosAngle,k=void 0===T?a.pxmid:I(f.r,T);if(v.targetX=o+k[0]*v.rCenter+(v.x||0),v.targetY=u+k[1]*v.rCenter+(v.y||0),O(v,_),v.outside){var A=v.targetY;a.yLabelMin=A-_.height/2,a.yLabelMid=A,a.yLabelMax=A+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}v.fontSize=m.size,h(p.type,v,r),e[i].transform=v,g.attr("transform",l.getTextTransform(v))}))}function L(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*f.r+","+n*f.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=l.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,p.title.font).call(c.convertToTspans,t),e="middle center"===p.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(f):E(f,i),r.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")})),x&&function(t,e){var r,n,a,i,o,s,l,c,u,h,f,p,g;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-g;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(d.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(a=3*s*Math.abs(c-h.indexOf(t)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(a),u=t[1-n][r],h=u.concat(c),p=[],f=0;fMath.abs(h)?s+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(i+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=s.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),A=i.h*(T.y[1]-T.y[0]),M=(.5*k-f.r)/i.w,C=(.5*A-f.r)/i.h;a.autoMargin(t,"pie."+p.uid+".automargin",{xl:T.x[0]-M,xr:T.x[1]+M,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(f.cx-f.r-w.left,0),r:Math.max(w.right-(f.cx+f.r),0),b:Math.max(w.bottom-(f.cy+f.r),0),t:Math.max(f.cy-f.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:E,prerenderTitles:x,layoutAreas:P,attachFxHandlers:v,computeTransform:O}},{"../../components/color":602,"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../bar/constants":878,"../bar/uniform_text":892,"./event_data":1118,"./helpers":1119,d3:165}],1124:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":892,"./style_one":1125,d3:165}],1125:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,s=a(i.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":602,"./helpers":1119}],1126:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1140}],1127:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),i=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,h=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(h){if(n=h,e=h.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),m=a(t.marker.border.color),v=t.opacity*t.marker.opacity;g[3]*=v,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,m[3]*=v,this.pointcloudOptions.borderColor=m;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=i(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=i(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":758,"../../plots/cartesian/autorange":782,"../scatter/get_trace_color":1150,"gl-pointcloud2d":302}],1128:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":735,"./attributes":1126}],1129:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":823,"../scatter3d/calc":1168,"./attributes":1126,"./convert":1127,"./defaults":1128}],1130:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/attributes"),i=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,h=t("../../lib/extend").extendFlat,f=t("../../plot_api/edit_types").overrideAll;t("../../constants/docs").FORMAT_LINK;(e.exports=f({hoverinfo:h({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":601,"../../components/colorscale/attributes":609,"../../components/fx/attributes":633,"../../constants/docs":706,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plot_api/plot_template":773,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/font_attributes":811,"../../plots/template_attributes":861}],1131:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),h=t("../../registry");function f(t,e){var r=t._fullData[e],n=t._fullLayout,a=n.dragmode,i="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==a&&"zoom"!==a){s(o,i);var f={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,a=t._fullData[e],i=a.node.groups.slice(),o=[];function s(t){for(var e=a._sankey.graph.nodes,r=0;ry&&(y=i.source[e]),i.target[e]>y&&(y=i.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(C,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(C)||w[E]!==w[C])){w.hasOwnProperty(C)&&(C=w[C]),w.hasOwnProperty(E)&&(E=w[E]),C=+C,f[E=+E]=f[C]=!0;var L="";i.label&&i.label[e]&&(L=i.label[e]);var P=null;L&&p.hasOwnProperty(L)&&(P=p[L]),c.push({pointNumber:e,label:L,color:u?i.color[e]:i.color,customdata:h?i.customdata[e]:i.customdata,concentrationscale:P,source:E,target:C,value:+S}),M.source.push(E),M.target.push(C)}}var I=b+_.length,z=o(r.color),O=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:z?r.color[e]:r.color,customdata:O?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var i=a.init2dArray(t,0),o=0;o1}))}(I,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":614,"../../lib":735,"../../lib/gup":733,"strongly-connected-components":528}],1133:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1134:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function h(t,e){function r(r,i){return n.coerce(t,e,a.link.colorscales,r,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,a,r,i)}var d=n.extendDeep(f.hoverlabel,t.hoverlabel),g=t.node,m=c.newContainer(e,"node");function v(t,e){return n.coerce(g,m,a.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(g,m,v,d),v("hovertemplate");var y=f.colorway;v("color",m.label.map((function(t,e){return i.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,a.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(f.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:h}),s(e,f,p),p("orientation"),p("valueformat"),p("valuesuffix"),m.x.length&&m.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},f.font)),e._length=null}},{"../../components/color":602,"../../components/fx/hoverlabel_defaults":640,"../../lib":735,"../../plot_api/plot_template":773,"../../plots/array_container_defaults":779,"../../plots/domain":810,"./attributes":1130,tinycolor2:535}],1135:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1130,"./base_plot":1131,"./calc":1132,"./defaults":1134,"./plot":1136,"./select.js":1138}],1136:[function(t,e,r){"use strict";var n=t("d3"),a=t("./render"),i=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,c=s._;function u(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function f(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function p(t){n.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function v(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+l.sankeyNode).filter(g(t)).call(m)}function x(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(l.sankeyNode).filter(g(t)).call(v)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,h=r._size,d=0;d"),color:b(s,"bgcolor")||o.addOpacity(d.color,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:n.event.x"),color:b(o,"bgcolor")||a.tinyColorHue,borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),nameLength:b(o,"namelength"),textAlign:b(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});f(y,.85),p(y)}}},unhover:function(e,a,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(v,a,o),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:n.event,points:[a.node]})),i.loneUnhover(r._hoverlayer.node()))},select:function(e,r,a){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(v,r,a),i.click(t,{target:!0})}}})}},{"../../components/color":602,"../../components/fx":642,"../../lib":735,"./constants":1133,"./render":1137,d3:165}],1137:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),c=t("@plotly/d3-sankey-circular"),u=t("d3-force"),h=t("../../lib"),f=t("../../lib/gup"),p=f.keyFun,d=f.repeat,g=f.unwrap,m=t("d3-interpolate").interpolateNumber,v=t("../../registry");function y(t,e,r){var a,o=g(e),s=o.trace,u=s.domain,f="h"===s.orientation,p=s.node.pad,d=s.node.thickness,m=t.width*(u.x[1]-u.x[0]),v=t.height*(u.y[1]-u.y[0]),y=o._nodes,x=o._links,b=o.circular;(a=b?c.sankeyCircular().circularLinkGap(0):l.sankey()).iterations(n.sankeyIterations).size(f?[m,v]:[v,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(y).links(x);var _,w,T,k=a();for(var A in a.nodePadding()=a||(r=a-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),a=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),a=[],i=-1,o=-1/0;for(_=0;_o+d&&(i+=1,e=s.x0),o=s.x0,a[i]||(a[i]=[]),a[i].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return a}(y=k.nodes));a.update(k)}return{circular:b,key:r,trace:s,guid:h.randstr(),horizontal:f,width:m,height:v,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?v:m,dragPerpendicular:f?m:v,arrangement:s.arrangement,sankey:a,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function x(t,e,r){var n=i(e.color),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:b,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function b(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,i=t.link.target.x0,o=m(a,i),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,f=t.link.y1+t.link.width/2;return"M"+a+","+c+"C"+s+","+c+" "+l+","+h+" "+i+","+h+"L"+i+","+f+"C"+l+","+f+" "+s+","+u+" "+a+","+u+"Z"}}function _(t,e){var r=i(e.color),a=n.nodePadAcross,s=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var l=e.dx,c=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(l),visibleHeight:c,zoneX:-a,zoneY:-s,zoneWidth:l+2*a,zoneHeight:c+2*s,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:o.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function w(t){t.attr("transform",(function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"}))}function T(t){t.call(w)}function k(t,e){t.call(T),e.attr("d",b())}function A(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function M(t){return t.link.width>1||t.linkLineWidth>0}function S(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function E(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function C(t){return a.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function L(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function P(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function I(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function z(t){return t.horizontal&&t.left?"100%":"0%"}function O(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,a){!function(t){for(var e=0;e0&&a.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,a),function(t,e,r,a,i){window.requestAnimationFrame((function o(){var s;for(s=0;s0)window.requestAnimationFrame(o);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),k(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e5?t.node.label:""})).attr("text-anchor",(function(t){return t.horizontal&&t.left?"end":"start"})),q.transition().ease(n.ease).duration(n.duration).attr("startOffset",z).style("fill",I)}},{"../../components/color":602,"../../components/drawing":624,"../../lib":735,"../../lib/gup":733,"../../registry":866,"./constants":1133,"@plotly/d3-sankey":56,"@plotly/d3-sankey-circular":55,d3:165,"d3-force":158,"d3-interpolate":160,tinycolor2:535}],1138:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,a=n._sankey.graph.nodes,i=0;is&&A[m].gap;)m--;for(y=A[m].s,d=A.length-1;d>m;d--)A[d].s=y;for(;sM[u]&&u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],1147:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./stack_defaults"),u=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),p=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function m(r,a){return n.coerce(t,e,i,r,a)}var v=l(t,e,g,m);if(v||(e.visible=!1),e.visible){var y=c(t,e,g,m),x=!y&&vG!=(F=I[L][1])>=G&&(O=I[L-1][0],D=I[L][0],F-R&&(z=O+(D-O)*(G-R)/(F-R),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var Y=s.defaultLine;return s.opacity(h.fillcolor)?Y=h.fillcolor:s.opacity((h.line||{}).color)&&(Y=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:Y,hovertemplate:!1}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":602,"../../components/fx":642,"../../lib":735,"../../registry":866,"./get_trace_color":1150}],1152:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"./arrays_to_calcdata":1139,"./attributes":1140,"./calc":1141,"./cross_trace_calc":1145,"./cross_trace_defaults":1146,"./defaults":1147,"./format_labels":1149,"./hover":1151,"./marker_colorbar":1158,"./plot":1160,"./select":1161,"./style":1163,"./subtypes":1164}],1153:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735}],1154:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,h=t("./constants");e.exports=function(t,e){var r,n,i,f,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S=e.xaxis,E=e.yaxis,C="log"===S.type,L="log"===E.type,P=S._length,I=E._length,z=e.connectGaps,O=e.baseTolerance,D=e.shape,R="linear"===D,F=e.fill&&"none"!==e.fill,B=[],N=h.minTolerance,j=t.length,V=new Array(j),U=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?E.l2p(n.y):E.c2p(n.y);if(i===a){if(C&&(i=S.c2p(n.x,!0)),i===a)return!1;L&&l===a&&(i*=Math.abs(S._m*I*(S._m>0?o:s)/(E._m*P*(E._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=E.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function H(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,c=a*o+i*s;if(c>0&&crt||t[1]at)return[u(t[0],et,rt),u(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var c=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===V[U-1][0],a=r===V[U-1][1];if(!n||!a)if(U>1){var i=e===V[U-2][0],o=r===V[U-2][1];n&&(e===et||e===rt)&&i?o?U--:V[U-1]=t:a&&(r===nt||r===at)&&o?i?U--:V[U-1]=t:V[U++]=t}else V[U++]=t}function ut(t){V[U-1][0]!==t[0]&&V[U-1][1]!==t[1]&&ct([X,J]),ct(t),K=null,X=J=0}function ht(t){if(A=t[0]/P,M=t[1]/I,W=t[0]rt?rt:0,Z=t[1]at?at:0,W||Z){if(U)if(K){var e=$(K,t);e.length>1&&(ut(e[0]),V[U++]=e[1])}else Q=$(V[U-1],t)[0],V[U++]=Q;else V[U++]=[W||t[0],Z||t[1]];var r=V[U-1];W&&Z&&(r[0]!==W||r[1]!==Z)?(K&&(X!==W&&J!==Z?ct(X&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[X||W,J||Z]):X&&J&&ct([X,J])),ct([W,Z])):X-W&&J-Z&&ct([W||X,Z||J]),K=t,X=W,J=Z}else K&&ut($(K,t)[0]),V[U++]=t;var n,a,i,o}for("linear"===D||"spline"===D?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=c(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ft))break;i=d,(_=v[0]*m[0]+v[1]*m[1])>x?(x=_,f=d,g=!1):_=t.length||!d)break;ht(d),n=d}}else ht(f)}K&&ct([X||K[0],J||K[1]]),B.push(V.slice(0,U))}return B}},{"../../constants/numerical":711,"../../lib":735,"./constants":1144}],1155:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1156:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,c={},u=!1,h=-1,f=0,p=-1;for(i=0;i=0?l=p:(l=p=f,f++),l0?Math.max(e,a):0}}},{"fast-isnumeric":237}],1158:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1159:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":602,"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"./subtypes":1164}],1160:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),h=t("./link_traces"),f=t("../../lib/polygon").tester;function p(t,e,r,h,p,d,g){var m;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),h=n.extent(i.simpleMap(l.range,l.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var d=a.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),g=Math.ceil(d.length/p),m=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=h[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var E,C;y(T).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),h[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,z="",O=[],D=_._prevtrace;D&&(z=D._prevRevpath||"",C=D._nextFill,O=D._polygons);var R,F,B,N,j,V,U,q="",H="",G=[],Y=i.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(h),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(h,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),m=0;m1){var r=n.select(this);if(r.datum(h),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),l.singleLineStyle(h,a)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(h),N&&V&&(L?("y"===L?N[1]=V[1]=b.c2p(0,!0):"x"===L&&(N[0]=V[0]=x.c2p(0,!0)),y(E).attr("d","M"+V+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):y(E).attr("d",q+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(l.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(O)):(X(C),_._polygons=null)),_._prevRevpath=H,_._prevPolygons=U):(E?X(E):C&&X(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(h),S.datum(h),function(e,a,i){var o,u=i[0].trace,h=c.hasMarkers(u),f=c.hasText(u),p=tt(u),d=et,g=et;if(h||f){var m=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?m=w?K:J:_&&!w&&(m=Q),h&&(d=m),f&&(g=m)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),h&&(T=l.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,x,b)?(l.singlePointStyle(e,i,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,h);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,f,d=!i,g=!!i&&i.duration>0,m=h(t,e,r);((u=a.selectAll("g.trace").data(m,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){i[t]=null})).remove(),u.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(t,n,e,r,m,this,i)}))}))):u.each((function(r,n){p(t,n,e,r,m,this,i)}));d&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":624,"../../lib":735,"../../lib/polygon":747,"../../registry":866,"./line_points":1154,"./link_traces":1156,"./subtypes":1164,d3:165}],1161:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r0){var f=a.c2l(u);a._lowerLogErrorBound||(a._lowerLogErrorBound=f),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,f)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[a(t.x,t.error_x,e[0],r.xaxis),a(t.y,t.error_y,e[1],r.yaxis),a(t.z,t.error_z,e[2],r.zaxis)],i=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,a){var i=null;if(l.isArrayOrTypedArray(t)){i=[];for(var o=0;o=0){var g=function(t,e,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n=0&&h("surfacecolor",f||p);for(var d=["x","y","z"],g=0;g<3;++g){var m="projection."+d[g];h(m+".show")&&(h(m+".opacity"),h(m+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,f||p||r,{axis:"z"}),v(t,e,f||p||r,{axis:"y",inherit:"z"}),v(t,e,f||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":735,"../../registry":866,"../scatter/line_defaults":1153,"../scatter/marker_defaults":1159,"../scatter/subtypes":1164,"../scatter/text_defaults":1165,"./attributes":1167}],1172:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":709,"../../plots/gl3d":825,"./attributes":1167,"./calc":1168,"./convert":1170,"./defaults":1171}],1173:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:i()}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1174:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,h,f=e._length,p=new Array(f),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,m.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":735,"../scatter/hover":1151}],1179:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1173,"./calc":1174,"./defaults":1175,"./event_data":1176,"./format_labels":1177,"./hover":1178,"./plot":1180}],1180:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../plots/cartesian/axes"),i=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,h={xaxis:a.getFromId(t,u.xaxis||"x"),yaxis:a.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,h,r,o),s=0;s")}(c,g,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../scatter/get_trace_color":1150,"./attributes":1181}],1187:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":815,"../scatter/marker_colorbar":1158,"../scatter/style":1163,"./attributes":1181,"./calc":1182,"./defaults":1183,"./event_data":1184,"./format_labels":1185,"./hover":1186,"./plot":1188,"./select":1189,"./style":1190}],1188:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,h=t("../scatter/subtypes"),f=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,a=t[0].trace,o=e[a.geo],h=o._subplot,f=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):i(a,h.topojson);for(r=0;r=g,T=2*_,k={},A=e._x=y.makeCalcdata(e,"x"),M=e._y=x.makeCalcdata(e,"y"),S=new Array(T);for(r=0;r<_;r++)o=A[r],s=M[r],S[2*r]=o===d?NaN:o,S[2*r+1]=s===d?NaN:s;if("log"===y.type)for(r=0;r1&&a.extendFlat(s.line,f.linePositions(t,r,n));if(s.errorX||s.errorY){var l=f.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},f.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},f.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},f.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,S,A,M),P=p(t,b);return u(v,e),w?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=l(e,_),c(t,e,y,x,A,M,C),L.errorX&&m(e,y,L.errorX),L.errorY&&m(e,x,L.errorY),L.fill&&!P.fill2d&&(P.fill2d=!0),L.marker&&!P.scatter2d&&(P.scatter2d=!0),L.line&&!P.line2d&&(P.line2d=!0),!L.errorX&&!L.errorY||P.error2d||(P.error2d=!0),L.text&&!P.glText&&(P.glText=!0),L.marker&&(L.marker.snap=_),P.lineOptions.push(L.line),P.errorXOptions.push(L.errorX),P.errorYOptions.push(L.errorY),P.fillOptions.push(L.fill),P.markerOptions.push(L.marker),P.markerSelectedOptions.push(L.markerSel),P.markerUnselectedOptions.push(L.markerUnsel),P.textOptions.push(L.text),P.textSelectedOptions.push(L.textSel),P.textUnselectedOptions.push(L.textUnsel),P.selectBatch.push([]),P.unselectBatch.push([]),k._scene=P,k.index=P.count,k.x=A,k.y=M,k.positions=S,P.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/autorange":782,"../../plots/cartesian/axis_ids":786,"../scatter/calc":1141,"../scatter/colorscale_calc":1143,"./constants":1193,"./convert":1194,"./scene_update":1202,"point-cluster":474}],1193:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1194:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,h=t("../scatter/subtypes"),f=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,h=o.size,f=o.family,p={},d=e.texttemplate;if(d){p.text=[];var g=a._d3locale,m=Array.isArray(d),y=m?Math.min(d.length,i):i,x=m?function(t){return d[t]}:function(){return d};for(r=0;rd.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var f=n[0],p=n[1];for(a=0;a1?l[a]:l[0]:l,d=Array.isArray(c)?c.length>1?c[a]:c[0]:c,g=m[p],v=m[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[a]=[g*y/f,x/f]}}return o}}},{"../../components/drawing":624,"../../components/fx/helpers":638,"../../constants/interactions":710,"../../lib":735,"../../lib/gl_format_color":732,"../../plots/cartesian/axis_ids":786,"../../registry":866,"../scatter/make_bubble_size_func":1157,"../scatter/subtypes":1164,"./constants":1193,"./helpers":1198,"color-normalize":122,"fast-isnumeric":237,"svg-path-sdf":533}],1195:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),f=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,d){function g(r,a){return n.coerce(t,e,o,r,a)}var m=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=l.isBubble(t),y=c(t,e,d,g);if(y){var x=y100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1193}],1199:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,h=t.index,f={pointNumber:h,x:e[h],y:r[h]};f.tx=Array.isArray(o.text)?o.text[h]:o.text,f.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,f.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,f.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var p=o.textfont;p&&(f.ts=a.isArrayOrTypedArray(p.size)?p.size[h]:p.size,f.tc=Array.isArray(p.color)?p.color[h]:p.color,f.tf=Array.isArray(p.family)?p.family[h]:p.family);var d=o.marker;d&&(f.ms=a.isArrayOrTypedArray(d.size)?d.size[h]:d.size,f.mo=a.isArrayOrTypedArray(d.opacity)?d.opacity[h]:d.opacity,f.mx=a.isArrayOrTypedArray(d.symbol)?d.symbol[h]:d.symbol,f.mc=a.isArrayOrTypedArray(d.color)?d.color[h]:d.color);var g=d&&d.line;g&&(f.mlc=Array.isArray(g.color)?g.color[h]:g.color,f.mlw=a.isArrayOrTypedArray(g.width)?g.width[h]:g.width);var m=d&&d.gradient;m&&"none"!==m.type&&(f.mgt=Array.isArray(m.type)?m.type[h]:m.type,f.mgc=Array.isArray(m.color)?m.color[h]:m.color);var v=s.c2p(f.x,!0),y=l.c2p(f.y,!0),x=f.mrc||1,b=o.hoverlabel;b&&(f.hbg=Array.isArray(b.bgcolor)?b.bgcolor[h]:b.bgcolor,f.hbc=Array.isArray(b.bordercolor)?b.bordercolor[h]:b.bordercolor,f.hts=a.isArrayOrTypedArray(b.font.size)?b.font.size[h]:b.font.size,f.htc=Array.isArray(b.font.color)?b.font.color[h]:b.font.color,f.htf=Array.isArray(b.font.family)?b.font.family[h]:b.font.family,f.hnl=a.isArrayOrTypedArray(b.namelength)?b.namelength[h]:b.namelength);var _=o.hoverinfo;_&&(f.hi=Array.isArray(_)?_[h]:_);var w=o.hovertemplate;w&&(f.ht=Array.isArray(w)?w[h]:w);var T={};T[t.index]=f;var k=a.extendFlat({},t,{color:i(o,f),x0:v-x,x1:v+x,xLabelVal:f.x,y0:y-x,y1:y+x,yLabelVal:f.y,cd:T,distance:c,spikeDistance:u,hovertemplate:f.ht});return f.htx?k.text=f.htx:f.tx?k.text=f.tx:o.text&&(k.text=o.text),a.fillText(f,o,k),n.getComponentMethod("errorbars","hoverInfo")(f,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,c,u,h,f,p,d=t.cd,g=d[0].t,m=d[0].trace,v=t.xa,y=t.ya,x=g.x,b=g.y,_=v.c2p(e),w=y.c2p(r),T=t.distance;if(g.tree){var k=v.p2c(_-T),A=v.p2c(_+T),M=y.p2c(w-T),S=y.p2c(w+T);a="x"===n?g.tree.range(Math.min(k,A),Math.min(y._rl[0],y._rl[1]),Math.max(k,A),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(k,A),Math.min(M,S),Math.max(k,A),Math.max(M,S))}else a=g.ids;var E=T;if("x"===n)for(c=0;c-1;c--)s=x[a[c]],l=b[a[c]],u=v.c2p(s)-_,h=y.c2p(l)-w,(f=Math.sqrt(u*u+h*h))v.glText.length){var w=b-v.glText.length;for(d=0;dr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var h,f,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(h=0;hh&&isNaN(d[f+1]);)f-=2;0!==d[h+1]&&(p=[d[h],0]),p=p.concat(d.slice(h,f+2)),0!==d[f+1]&&(p=p.concat([d[f],0]))}else if("tozerox"===s.fill){for(h=0;hh&&isNaN(d[f]);)f-=2;0!==d[h]&&(p=[0,d[h+1]]),p=p.concat(d.slice(h,f+2)),0!==d[f]&&(p=p.concat([0,d[f+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],a=0,i=0;i-1;for(d=0;d=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=f.project([n,i]),l=o.x-u.c2p([d,i]),c=o.y-h.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)}),t),!1!==t.index){var g=l[t.index],m=g.lonlat,v=[a.modHalf(m[0],360)+p,m[1]],y=u.c2p(v),x=h.c2p(v),b=g.mrc||1;t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b;var _={};_[c.subplot]={_subplot:f};var w=c._module.formatLabels(g,c,_);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=i(c,g),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),a=-1!==n.indexOf("all"),i=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"\xb0"}a||i&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):i?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(a||-1!==n.indexOf("text"))&&o(e,t,c);return c.join("
")}(c,g,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../scatter/get_trace_color":1150}],1210:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":840,"../scatter/marker_colorbar":1158,"../scattergeo/calc":1182,"./attributes":1204,"./defaults":1206,"./event_data":1207,"./format_labels":1208,"./hover":1209,"./plot":1211,"./select":1212}],1211:[function(t,e,r){"use strict";var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(t.gd,e),l=a.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,a(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:a}},{"../scatter/hover":1151}],1218:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":849,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1213,"./calc":1214,"./defaults":1215,"./format_labels":1216,"./hover":1217,"./plot":1219}],1219:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!f.fill2d&&(f.fill2d=!0),y.marker&&!f.scatter2d&&(f.scatter2d=!0),y.line&&!f.line2d&&(f.line2d=!0),y.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(y.line),f.fillOptions.push(y.fill),f.markerOptions.push(y.marker),f.markerSelectedOptions.push(y.markerSel),f.markerUnselectedOptions.push(y.markerUnsel),f.textOptions.push(y.text),f.textSelectedOptions.push(y.textSel),f.textUnselectedOptions.push(y.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=m,d.theta=v,d.positions=_,d._scene=f,d.index=f.count,f.count++}})),i(t,e,r)}}},{"../../lib":735,"../scattergl/constants":1193,"../scattergl/convert":1194,"../scattergl/plot":1201,"../scattergl/scene_update":1202,"fast-isnumeric":237,"point-cluster":474}],1227:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/template_attributes").texttemplateAttrs,i=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=i.marker,h=i.line,f=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},i.hovertext,{}),line:{color:h.color,width:h.width,dash:l,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:c({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":609,"../../components/drawing/attributes":623,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1228:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,h,f,p,d,g=t._fullLayout[e.subplot].sum,m=e.sum||g,v={a:e.a,b:e.b,c:e.c};for(r=0;r"),o.hovertemplate=f.hovertemplate,i}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":1151}],1233:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":862,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1227,"./calc":1228,"./defaults":1229,"./event_data":1230,"./format_labels":1231,"./hover":1232,"./plot":1234}],1234:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":1160}],1235:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,c=t("../../lib/extend").extendFlat,u=n.marker,h=u.line,f=c(a("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),p=c(a("marker"),{symbol:u.symbol,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:f,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:c({},o.text,{}),hovertext:c({},o.hovertext,{}),hovertemplate:i(),marker:p,xaxes:d("x"),yaxes:d("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/plot_template":773,"../../plots/cartesian/constants":789,"../../plots/template_attributes":861,"../scatter/attributes":1140,"../scattergl/attributes":1191}],1236:[function(t,e,r){"use strict";var n=t("regl-line2d"),a=t("../../registry"),i=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,c=t("../../plots/cartesian/axes").shouldShowZeroLine;function u(t,e,r){for(var n=r.matrixOptions.data.length,a=e._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;of?2*(b.sizeAvg||Math.max(b.size,3)):i(e,x),p=0;pi&&l||a-1,M=!0;if(o(x)||!!p.selectedpoints||A){var S=p._length;if(p.selectedpoints){g.selectBatch=p.selectedpoints;var E=p.selectedpoints,C={};for(l=0;l1&&(u=g[y-1],f=m[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){y=0,M=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,a=t.dataScale,u=e._len,h={};function d(t,e){var n=r[e],o=a[c[e]];return i.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(h.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var g=d(e._Xs,"xaxis"),m=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(h.meshgrid=[g,m,v],h.gridFill=e._gridFill,e._slen)h.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=m[0],x=f(g),b=f(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(m.length,x.length),l=function(t){return A(m[t])&&M(t)},h=function(t){return String(m[t])}):(r=Math.min(y.length,x.length),l=function(t){return A(y[t])&&M(t)},h=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=i.randstr(),I=0;I"),name:k||z("name")?l.name:void 0,color:T("hoverlabel.bgcolor")||y.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:k,hovertemplateLabels:L,eventData:[h(a,l,f.eventDataKeys)]};m&&(R.x0=S-a.rInscribed*a.rpx1,R.x1=S+a.rInscribed*a.rpx1,R.idealAlign=a.pxmid[0]<0?"left":"right"),v&&(R.x=S,R.idealAlign=S<0?"left":"right"),o.loneHover(R,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}),d._hasHoverLabel=!0}if(v){var F=t.select("path.surface");f.styleOne(F,a,l,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:[h(a,l,f.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var a=r._fullLayout,i=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[h(s,i,f.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(a._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");f.styleOne(l,s,i,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,i=r._fullData[d.index],s=m&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(g,u):c.findEntryWithLevel(g,u),v=c.getPtId(p),y={points:[h(t,i,f.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[h(t,i,f.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){a.call("_storeDirectGUIEdit",i,e._tracePreGUI[i.uid],{level:i.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),a.call("animate",r,b,_)}}))}},{"../../components/fx":642,"../../components/fx/helpers":638,"../../lib":735,"../../lib/events":725,"../../registry":866,"../pie/helpers":1119,"./helpers":1257,d3:165}],1257:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var a=t.children||[],i=0;i0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var a=e?[n.data[e]]:[n];return r.listPath(n,e).concat(a)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":602,"../../lib":735,"../../lib/setcursor":755,"../pie/helpers":1119}],1258:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1158,"./attributes":1251,"./base_plot":1252,"./calc":1253,"./defaults":1255,"./layout_attributes":1259,"./layout_defaults":1260,"./plot":1261,"./style":1262}],1259:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1260:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":735,"./layout_attributes":1259}],1261:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-hierarchy"),i=t("../../components/drawing"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../bar/uniform_text"),c=l.recordMinTextSize,u=l.clearMinTextSize,h=t("../pie/plot"),f=h.computeTransform,p=h.transformInsideText,d=t("./style").styleOne,g=t("../bar/style").resizeText,m=t("./fx"),v=t("./constants"),y=t("./helpers");function x(t,e,l,u){var h=t._fullLayout,g=!h.uniformtext.mode&&y.hasTransition(u),x=n.select(l).selectAll("g.slice"),_=e[0],w=_.trace,T=_.hierarchy,k=y.findEntryWithLevel(T,w.level),A=y.getMaxDepth(w),M=h._size,S=w.domain,E=M.w*(S.x[1]-S.x[0]),C=M.h*(S.y[1]-S.y[0]),L=.5*Math.min(E,C),P=_.cx=M.l+M.w*(S.x[1]+S.x[0])/2,I=_.cy=M.t+M.h*(1-S.y[0])-C/2;if(!k)return x.remove();var z=null,O={};g&&x.each((function(t){O[y.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!z&&y.isEntry(t)&&(z=t)}));var D=function(t){return a.partition().size([2*Math.PI,t.height+1])(t)}(k).descendants(),R=k.height+1,F=0,B=A;_.hasMultipleRoots&&y.isHierarchyRoot(k)&&(D=D.slice(1),R-=1,F=1,B+=1),D=D.filter((function(t){return t.y1<=B}));var N=Math.min(R,A),j=function(t){return(t-F)/N*L},V=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},U=function(t){return o.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,P,I)},q=function(t){return P+b(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},H=function(t){return I+b(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(x=x.data(D,y.getPtId)).enter().append("g").classed("slice",!0),g?x.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=y.getPtId(t),a=O[r],i=O[y.getPtId(k)];if(i){var o=t.x1>i.x1?2*Math.PI:0;e=t.rpx1G?2*Math.PI:0;e={x0:i,x1:i}}else e={rpx0:L,rpx1:L},o.extendFlat(e,Z(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,a)}(t);return function(t){return U(e(t))}})):u.attr("d",U),l.call(m,k,t,e,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(y.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),u.call(d,a,w);var x=o.ensureSingle(l,"g","slicetext"),b=o.ensureSingle(x,"text","",(function(t){t.attr("data-notex",1)})),T=o.ensureUniformFontSize(t,y.determineTextFont(w,a,h.font));b.text(r.formatSliceLabel(a,k,w,e,h)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(s.convertToTspans,t);var A=i.bBox(b.node());a.transform=p(A,a,_),a.transform.targetX=q(a),a.transform.targetY=H(a);var M=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,c(w.type,r,h),o.getTextTransform(r)};g?b.transition().attrTween("transform",(function(t){var e=function(t){var e,r=O[y.getPtId(t)],a=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:a.textPosAngle,scale:0,rotate:a.rotate,rCenter:a.rCenter,x:a.x,y:a.y}},z)if(t.parent)if(G){var i=t.x1>G?2*Math.PI:0;e.x0=e.x1=i}else o.extendFlat(e,Z(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var s=n.interpolate(e.transform.textPosAngle,t.transform.textPosAngle),l=n.interpolate(e.rpx1,t.rpx1),u=n.interpolate(e.x0,t.x0),f=n.interpolate(e.x1,t.x1),p=n.interpolate(e.transform.scale,a.scale),d=n.interpolate(e.transform.rotate,a.rotate),g=0===a.rCenter?3:0===e.transform.rCenter?1/3:1,m=n.interpolate(e.transform.rCenter,a.rCenter);return function(t){var e=l(t),r=u(t),n=f(t),i=function(t){return m(Math.pow(t,g))}(t),o={pxmid:V(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:i,x:a.x,y:a.y}};return c(w.type,a,h),{transform:{targetX:q(o),targetY:H(o),scale:p(t),rotate:d(t),rCenter:i}}}}(t);return function(t){return M(e(t),A)}})):b.attr("transform",M(a,A))}))}function b(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,a){var i,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,h=!s.uniformtext.mode&&y.hasTransition(r);(u("sunburst",s),(i=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),i.order(),h)?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){x(t,e,this,r)}))}))):(i.each((function(e){x(t,e,this,r)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&i.exit().remove()},r.formatSliceLabel=function(t,e,r,n,a){var i=r.texttemplate,s=r.textinfo;if(!(i||s&&"none"!==s))return"";var l=a.separators,c=n[0],u=t.data.data,h=c.hierarchy,f=y.isHierarchyRoot(t),p=y.getParent(h,t),d=y.getValue(t);if(!i){var g,m=s.split("+"),v=function(t){return-1!==m.indexOf(t)},x=[];if(v("label")&&u.label&&x.push(u.label),u.hasOwnProperty("v")&&v("value")&&x.push(y.formatValue(u.v,l)),!f){v("current path")&&x.push(y.getPath(t.data));var b=0;v("percent parent")&&b++,v("percent entry")&&b++,v("percent root")&&b++;var _=b>1;if(b){var w,T=function(t){g=y.formatPercent(w,l),_&&(g+=" of "+t),x.push(g)};v("percent parent")&&!f&&(w=d/y.getValue(p),T("parent")),v("percent entry")&&(w=d/y.getValue(e),T("entry")),v("percent root")&&(w=d/y.getValue(h),T("root"))}}return v("text")&&(g=o.castOption(r,u.i,"text"),o.isValidTextValue(g)&&x.push(g)),x.join("
")}var k=o.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=y.formatValue(u.v,l)),A.currentPath=y.getPath(t.data),f||(A.percentParent=d/y.getValue(p),A.percentParentLabel=y.formatPercent(A.percentParent,l),A.parent=y.getPtLabel(p)),A.percentEntry=d/y.getValue(e),A.percentEntryLabel=y.formatPercent(A.percentEntry,l),A.entry=y.getPtLabel(e),A.percentRoot=d/y.getValue(h),A.percentRootLabel=y.formatPercent(A.percentRoot,l),A.root=y.getPtLabel(h),u.hasOwnProperty("color")&&(A.color=u.color);var M=o.castOption(r,u.i,"text");return(o.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=o.castOption(r,u.i,"customdata"),o.texttemplateString(k,A,a._d3locale,A,r._meta||{})}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../bar/style":890,"../bar/uniform_text":892,"../pie/plot":1123,"./constants":1254,"./fx":1256,"./helpers":1257,"./style":1262,d3:165,"d3-hierarchy":159}],1262:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":602,"../../lib":735,"../bar/uniform_text":892,d3:165}],1263:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function c(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},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}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})},hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/color":602,"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plots/attributes":780,"../../plots/template_attributes":861}],1264:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":610}],1265:[function(t,e,r){"use strict";var n=t("gl-surface3d"),a=t("ndarray"),i=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,c=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,h=t("../heatmap/interp2d"),f=t("../heatmap/find_empties");function p(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var d=p.prototype;d.getXat=function(t,e,r,n){var a=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?a:n.d2l(a,0,r)},d.getYat=function(t,e,r,n){var a=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?a:n.d2l(a,0,r)},d.getZat=function(t,e,r,n){var a=this.data.z[e][t];return null===a&&this.data.connectgaps&&this.data._interpolatedZ&&(a=this.data._interpolatedZ[e][t]),void 0===r?a:n.d2l(a,0,r)},d.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),a=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,a],t.traceCoordinate=[this.getXat(n,a),this.getYat(n,a),this.getZat(n,a)],t.dataCoordinate=[this.getXat(n,a,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,a,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,a,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var i=0;i<3;i++){var o=t.dataCoordinate[i];null!=o&&(t.dataCoordinate[i]*=this.scene.dataScale[i])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[a]&&void 0!==s[a][n]?t.textLabel=s[a][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var g=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=g[n];break}return r}function x(t,e){if(!(t<1||e<1)){for(var r=v(t),n=v(e),a=1,i=0;iw;)r--,r/=y(r),++r<_&&(r=w);var n=Math.round(r/t);return n>1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),c=1+n+1,u=1+o+1,h=a(new Float32Array(c*u),[c,u]),f=0;f0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,e=this.contourStart[t];ei&&(this.minValues[e]=i),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1272:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/extend").extendFlat,i=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[a]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},a+=i,s=c+1,i=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var g=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),m=e.domain,v=Math.floor(t._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(t._fullLayout._size.h*(m.y[1]-m.y[0])),x=e.header.values.length?g[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=f(b,y-_+n.uplift),T=h(f(x,_),[]),k=h(w,T),A={},M=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=g.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var C=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:m.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-m.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:C,height:y,columnOrder:M,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:a({},e.cells,{values:r}),headerCells:a({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=u(t)})),L}},{"../../lib/extend":726,"./constants":1271,"fast-isnumeric":237}],1273:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":726}],1274:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,a=r.slice(0,n),i=a.slice().sort((function(t,e){return t-e})),o=a.map((function(t){return i.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var h,f,p=u?"":_(t.calcdata.cells.prefix,e,r)||"",d=u?"":_(t.calcdata.cells.suffix,e,r)||"",g=u?null:_(t.calcdata.cells.format,e,r)||null,m=p+(g?a.format(g)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=b(m)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?b(m):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?m.replace(/a&&n.push(i),a+=l}return n}(a,l,s);1===c.length&&(c[0]===a.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){return"translate(0 "+(z(t.rowBlocks,t.page)-t.scrollY)+")"})),t&&(E(t,r,e,c,n.prevPages,n,0),E(t,r,e,c,n.prevPages,n,1),v(r,t))}}function S(t,e,r,i){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===i?s.scrollY+c*a.event.dy:i;var h=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(T);return M(t,h,l),s.scrollY===u}}function E(t,e,r,n,a,i,o){n[o]!==a[o]&&(clearTimeout(i.currentRepaint[o]),i.currentRepaint[o]=setTimeout((function(){var i=r.filter((function(t,e){return e===o&&n[e]!==a[e]}));y(t,e,i,r),a[o]=n[o]})))}function C(t,e,r,i){return function(){var o=a.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,a,i=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(a=(r=s.shift()).width+i)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=a;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),x(o.select("."+n.cn.cellText),r,t,i),a.select(e.parentNode.parentNode).call(I)}}function L(t,e,r,i,o){return function(){if(!o.settledY){var s=a.select(e.parentNode),l=R(o),c=o.key-l.firstRowIndex,u=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:u,f=Math.max(h,u);f-l.rows[c].rowHeight&&(l.rows[c].rowHeight=f,t.selectAll("."+n.cn.columnCell).call(I),M(null,t.filter(T),0),v(r,i,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=a.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),i=e.top-t.top+(r?r.matrix.f:n.cellPad);return"translate("+P(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+i+")"})),o.settledY=!0}}}function P(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function I(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+O(e,1/0)}),0);return"translate(0 "+(O(R(t),t.key)+e)+")"})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function z(t,e){for(var r=0,n=e-1;n>=0;n--)r+=D(t[n]);return r}function O(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:a({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/domain":810,"../../plots/template_attributes":861,"../pie/attributes":1114,"../sunburst/attributes":1251,"./constants":1280}],1278:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1279:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1253}],1280:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1281:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,r,c){function f(r,i){return n.coerce(t,e,a,r,i)}var p=f("labels"),d=f("parents");if(p&&p.length&&d&&d.length){var g=f("values");g&&g.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var m=f("text");f("texttemplate"),e.texttemplate||f("textinfo",Array.isArray(m)?"text+label":"label"),f("hovertext"),f("hovertemplate");var v=f("pathbar.visible");s(t,e,c,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var y=-1!==e.textposition.indexOf("bottom");f("marker.line.width")&&f("marker.line.color",c.paper_bgcolor);var x=f("marker.colors"),b=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;b?h(t,e,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(x||[]).length);var _=2*e.textfont.size;f("marker.pad.t",y?_/4:_),f("marker.pad.l",_/4),f("marker.pad.r",_/4),f("marker.pad.b",y?_:_/4),b&&h(t,e,c,f,{prefix:"marker.",cLetter:"c"}),e._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},v&&(f("pathbar.thickness",e.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),o(e,c,f),e._length=null}else e.visible=!1}},{"../../components/color":602,"../../components/colorscale":614,"../../lib":735,"../../plots/domain":810,"../bar/constants":878,"../bar/defaults":880,"./attributes":1277}],1282:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx");e.exports=function(t,e,r,f,p){var d=p.barDifY,g=p.width,m=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,A=p.makeUpdateTextInterpolator,M={},S=t._fullLayout,E=e[0],C=E.trace,L=E.hierarchy,P=g/C._entryDepth,I=u.listPath(r.data,"id"),z=s(L.copy(),[g,m],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+m,t.onPathbar=!0,!0)}))).reverse(),(f=f.data(z,u.getPtId)).enter().append("g").classed("pathbar",!0),T(f,!0,M,[g,m],x),f.order();var O=f;w&&(O=O.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),O.each((function(s){s._hoverX=v(s.x1-Math.min(g,m)/2),s._hoverY=y(s.y1-m/2);var f=n.select(this),p=a.ensureSingle(f,"path","surface",(function(t){t.style("pointer-events","all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,M,[g,m]);return function(t){return x(e(t))}})):p.attr("d",x),f.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,C,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=a.ensureSingle(f,"g","slicetext"),T=a.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=a.ensureUniformFontSize(t,u.determineTextFont(C,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,E).call(o.convertToTspans,t),s.textBB=i.bBox(T.node()),s.transform=b(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?T.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[g,m]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../sunburst/fx":1256,"../sunburst/helpers":1257,"./constants":1280,"./partition":1287,"./style":1289,d3:165}],1283:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx"),f=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var g=d.width,m=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._fullLayout,E=e[0].trace,C=-1!==E.textposition.indexOf("left"),L=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),I=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,z=s(r,[g,m],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),O=1/0,D=-1/0;z.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),D=Math.max(D,e))})),p=p.data(z,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-O+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[g,m],x),p.order();var R=null;if(w&&M){var F=u.getPtId(M);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:g,y0:0,y1:m}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){var p=u.isHeader(s,E);s._hoverX=v(s.x1-E.marker.pad.r),s._hoverY=y(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),T=a.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[g,m]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?I?"":u.getPtLabel(s)||"":f(s,r,E,e,S)||"";var M=a.ensureSingle(d,"g","slicetext"),z=a.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),O=a.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",L?"end":C||p?"start":"middle").call(i.font,O).call(o.convertToTspans,t),s.textBB=i.bBox(z.node()),s.transform=b(s,{fontSize:O.size,isHeader:p}),s.transform.fontSize=O.size,w?z.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[g,m]);return function(t){return _(e(t))}})):z.attr("transform",_(s))})),R}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../sunburst/fx":1256,"../sunburst/helpers":1257,"../sunburst/plot":1261,"./constants":1280,"./partition":1287,"./style":1289,d3:165}],1284:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"treemap",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1158,"./attributes":1277,"./base_plot":1278,"./calc":1279,"./defaults":1281,"./layout_attributes":1285,"./layout_defaults":1286,"./plot":1288,"./style":1289}],1285:[function(t,e,r){"use strict";e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1286:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("treemapcolorway",e.colorway),r("extendtreemapcolors")}},{"../../lib":735,"./layout_attributes":1285}],1287:[function(t,e,r){"use strict";var n=t("d3-hierarchy");e.exports=function(t,e,r){var a,i=r.flipX,o=r.flipY,s="dice-slice"===r.packing,l=r.pad[o?"bottom":"top"],c=r.pad[i?"right":"left"],u=r.pad[i?"left":"right"],h=r.pad[o?"top":"bottom"];s&&(a=c,c=l,l=a,a=u,u=h,h=a);var f=n.treemap().tile(function(t,e){switch(t){case"squarify":return n.treemapSquarify.ratio(e);case"binary":return n.treemapBinary;case"dice":return n.treemapDice;case"slice":return n.treemapSlice;default:return n.treemapSliceDice}}(r.packing,r.squarifyratio)).paddingInner(r.pad.inner).paddingLeft(c).paddingRight(u).paddingTop(l).paddingBottom(h).size(s?[e[1],e[0]]:e)(t);return(s||i||o)&&function t(e,r,n){var a;n.swapXY&&(a=e.x0,e.x0=e.y0,e.y0=a,a=e.x1,e.x1=e.y1,e.y1=a);n.flipX&&(a=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-a);n.flipY&&(a=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-a);var i=e.children;if(i)for(var o=0;o-1?E+P:-(L+P):0,z={x0:C,x1:C,y0:I,y1:I+L},O=function(t,e,r){var n=m.tiling.pad,a=function(t){return t-n<=e.x0},i=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return{x0:a(t.x0-n)?0:i(t.x0-n)?r[0]:t.x0,x1:a(t.x1+n)?0:i(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},D=null,R={},F={},B=null,N=function(t,e){return e?R[g(t)]:F[g(t)]},j=function(t,e,r,n){if(e)return R[g(v)]||z;var a=F[m.level]||r;return function(t){return t.data.depth-y.data.depth=(n-=v.r-o)){var y=(r+n)/2;r=y,n=y}var x;f?a<(x=i-v.b)&&x"===Q?(l.x-=i,c.x-=i,u.x-=i,h.x-=i):"/"===Q?(u.x-=i,h.x-=i,o.x-=i/2,s.x-=i/2):"\\"===Q?(l.x-=i,c.x-=i,o.x-=i/2,s.x-=i/2):"<"===Q&&(o.x-=i,s.x-=i),K(l),K(h),K(o),K(c),K(u),K(s),"M"+X(l.x,l.y)+"L"+X(c.x,c.y)+"L"+X(s.x,s.y)+"L"+X(u.x,u.y)+"L"+X(h.x,h.y)+"L"+X(o.x,o.y)+"Z"},toMoveInsideSlice:$,makeUpdateSliceInterpolator:et,makeUpdateTextInterpolator:rt,handleSlicesExit:nt,hasTransition:T,strTransform:at}):b.remove()}e.exports=function(t,e,r,i){var o,s,l=t._fullLayout,c=l._treemaplayer,f=!r;(u("treemap",l),(o=c.selectAll("g.trace.treemap").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("treemap",!0),o.order(),!l.uniformtext.mode&&a.hasTransition(r))?(i&&(s=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){s&&s()})).each("interrupt",(function(){s&&s()})).each((function(){c.selectAll("g.trace").each((function(e){m(t,e,this,r)}))}))):(o.each((function(e){m(t,e,this,r)})),l.uniformtext.mode&&h(t,l._treemaplayer.selectAll(".trace"),"treemap"));f&&o.exit().remove()}},{"../../lib":735,"../bar/constants":878,"../bar/plot":887,"../bar/style":890,"../bar/uniform_text":892,"../sunburst/helpers":1257,"./constants":1280,"./draw_ancestors":1282,"./draw_descendants":1283,d3:165}],1289:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,h=u.i,f=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&"rgba(0,0,0,0)"===f)d=0,s="rgba(0,0,0,0)",l=0;else if(s=i.castOption(r,h,"marker.line.color")||a.defaultLine,l=i.castOption(r,h,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var g=r.marker.depthfade;if(g){var m,v=a.combine(a.addOpacity(r._backgroundColor,.75),f);if(!0===g){var y=o.getMaxDepth(r);m=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else m=e.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var x=0;x0){var y,x,b,_,w,T=t.xa,k=t.ya;"h"===f.orientation?(w=e,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var A=h[t.index];if(w>=A.span[0]&&w<=A.span[1]){var M=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,f,w),C=o.getPositionOnKdePath(A,f,S),L=b._offset,P=b._length;M[y+"0"]=C[0],M[y+"1"]=C[1],M[x+"0"]=M[x+"1"]=S,M[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+h[0].t.labels.kde+" "+E.toFixed(3),M.spikeDistance=v[0].spikeDistance;var I=y+"Spike";M[I]=v[0][I],v[0].spikeDistance=void 0,v[0][I]=void 0,M.hovertemplate=!1,m.push(M),(u={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+P),u[y+"2"]=n.constrain(L+C[1],L,L+P),u[x+"1"]=u[x+"2"]=_._offset+S}}d&&(m=m.concat(v))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var z=l.selectAll(".violinline-"+f.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:m:c?(m.push(c),m):m}},{"../../lib":735,"../../plots/cartesian/axes":783,"../box/hover":906,"./helpers":1294}],1296:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../box/defaults":904,"../box/select":911,"../scatter/style":1163,"./attributes":1290,"./calc":1291,"./cross_trace_calc":1292,"./defaults":1293,"./hover":1295,"./layout_attributes":1297,"./layout_defaults":1298,"./plot":1299,"./style":1300}],1297:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":735,"../box/layout_attributes":908}],1298:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,(function(r,i){return n.coerce(t,e,a,r,i)}),"violin")}},{"../../lib":735,"../box/layout_defaults":909,"./layout_attributes":1297}],1299:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,h=e.xaxis,f=e.yaxis;function p(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),i=t[0],s=i.t,c=i.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,g=s.bdPos,m=e[s.valLetter+"axis"],v=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,a,i,o,l,h,f,_=n.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+d,!0),A=v.l2p(k);if(c.width)e=s.maxKDE/g;else{var M=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?M.maxKDE/g*(M.maxCount/t.pts.length):M.maxKDE/g}if(x){for(h=new Array(T),o=0;o")),c.color=function(t,e){var r=t[e.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(h,d),[c]}function w(t){return n(p,t)}}},{"../../components/color":602,"../../constants/delta.js":705,"../../plots/cartesian/axes":783,"../bar/hover":883}],1312:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../bar/select":888,"./attributes":1305,"./calc":1306,"./cross_trace_calc":1308,"./defaults":1309,"./event_data":1310,"./hover":1311,"./layout_attributes":1313,"./layout_defaults":1314,"./plot":1315,"./style":1316}],1313:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1314:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s0&&(m+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(a.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":602,"../../components/drawing":624,"../../constants/interactions":710,"../bar/style":890,"../bar/uniform_text":892,d3:165}],1317:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),a=t("../lib"),i=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,i){if(i.enabled){for(var o=i.target,l=a.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return h;case"first":return f;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return f(t)>s};case">=":return function(t){return f(t)>=s};case"[]":return function(t){var e=f(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=f(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=f(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=f(t);return es[1]};case"](":return function(t){var e=f(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=f(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(f(t))};case"}{":return function(t){return-1===s.indexOf(f(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),f),x={},b={},_=0;d?(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(m);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(i=0;i=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],501:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],502:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r,o=t[a];(l=o-((r=i+o)-i))&&(t[--n]=r,r=l)}var s=0;for(a=n;a>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function u(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",c(l(t)),")};return robustDeterminant",t].join(""))(a,i,n,o)}var h=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;h.length<6;)h.push(u(h.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,h.concat([h,u])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(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 c(e,t)}function u(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===a?r.push("+b[",i,"]"):r.push("+A[",i,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var i=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;i.length<6;)i.push(a(i.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,i.concat([i,a])),n=0;n<6;++n)e.exports[n]=i[n]}()},{"robust-determinant":503}],507:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],d=i*c,g=o*l,m=o*s,v=a*c,y=a*l,x=i*s,b=u*(d-g)+h*(m-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(u)+(Math.abs(m)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:f(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}!function(){for(;p.length<=5;)p.push(u(p.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),c=r[a],u=n[a],h=Math.min(c,u);if(Math.max(c,u)=n?(a=h,(l+=1)=n?(a=h,(l+=1)0?1:0}},{}],514:[function(t,e,r){"use strict";e.exports=function(t){return a(n(t))};var n=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":98,"reduce-simplicial-complex":494}],515:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,"undefined"==typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",a[0],"],c[",a[1],"])")}l.push("]")}l.push(");")}}for(i=t+1;i>1;--i){i>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function u(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[m],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],a=(1<>>u&1&&c.push(a[u]);e.push(c)}return s(e)},r.skeleton=h,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return m(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}var k=[],A=new Array(i);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=A[e],a=A[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:E,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":507,"simplicial-complex":519}],522:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),c=n(r,i,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,i),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,a=u.value):(a=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return a;p=h[f]}}if(p.start)if(s){var d=i(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(a=p.index)}else a=p.index;else p.y!==t[1]&&(a=p.index)}}}return a}},{"./lib/order-segments":522,"binary-search-bounds":523,"functional-red-black-tree":243,"robust-orientation":507}],525:[function(t,e,r){"use strict";var n=t("robust-dot-product"),a=t("robust-sum");function i(t,e){var r=a(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var a=-e/(n-e);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=t.length,s=new Array(o),l=0;l0||a>0&&u<0){var h=o(s,u,l,a);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(a,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(a,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":504,"robust-sum":512}],526:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,c,u,h,f,p=1,d=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",a=a.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+a).length,l=s.width&&u>0?c.repeat(u):"",g+=s.align?f+a+l:"0"===c?f+l+a:l+f+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],527:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(i[e]=0&&s[e].push(o[g])}i[e]=d}else{if(n[e]===r[e]){var m=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(a[x]=!1,m.push(x),v.push(s[x]),y+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(m);var b=new Array(y);for(d=0;d c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){");for(c=0;c<1<<(1<128&&c%128==0){h.length>0&&f.push("}}");var p="vExtra"+h.length;i.push("case ",c>>>7,":",p,"(m&0x7f,",l.join(),");break;"),f=["function ",p,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&c,":");for(var d=new Array(r),g=new Array(r),m=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+m[b]+"*c");var M=d[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+M+"*("+d[b].join("+")+A+")/("+g[b].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}i.push("}},"),h.length>0&&f.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,g=void 0===d?0:d,m=t.sweepFlag,v=void 0===m?0:m,y=[];if(0===u||0===h)return[];var x=Math.sin(p*a/360),b=Math.cos(p*a/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));var k=function(t,e,r,n,i,o,l,c,u,h,f,p){var d=Math.pow(i,2),g=Math.pow(o,2),m=Math.pow(f,2),v=Math.pow(p,2),y=d*g-d*v-g*m;y<0&&(y=0),y/=d*v+g*m;var x=(y=Math.sqrt(y)*(l===c?-1:1))*i/o*p,b=y*-o/i*f,_=h*x-u*b+(t+r)/2,w=u*x+h*b+(e+n)/2,T=(f-x)/i,k=(p-b)/o,A=(-f-x)/i,M=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,A,M);return 0===c&&E>0&&(E-=a),1===c&&E<0&&(E+=a),[_,w,S,E]}(e,r,l,c,u,h,g,v,x,b,_,w),A=n(k,4),M=A[0],S=A[1],E=A[2],C=A[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var P=Math.max(Math.ceil(L),1);C/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":63,assert:71,"is-svg-path":428,"normalize-svg-path":532,"parse-svg-path":465}],532:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,h=null,f=0,p=0,d=0,g=t.length;d4?(o=m[m.length-4],s=m[m.length-3]):(o=f,s=p),r.push(m)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":530}],533:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,h;e.shape?(r=e.shape[0],h=e.shape[1]):(r=c.width=e.w||e.width||200,h=c.height=e.h||e.height||200);var f=Math.min(r,h),p=e.stroke||0,d=e.viewbox||e.viewBox||a(t),g=[r/(d[2]-d[0]),h/(d[3]-d[1])],m=Math.min(g[0]||0,g[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,h),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*h),u.scale(m,m),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=i(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}},{"bitmap-sdf":96,"draw-svg-path":170,"is-svg-path":428,"parse-svg-path":465,"svg-path-bounds":531}],534:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(h+=.02);var p=new Float32Array(u),d=0,g=-.5*h;for(f=0;f1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,u),h=!0,f="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,d,g;return i=C(i),{ok:h,format:e.format||f,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),c=(i+l)/2;if(i==l)n=a=0;else{var u=i-l;switch(a=c>.5?u/(2-i-l):u/(i+l),i){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[z(i(t).toString(16)),z(i(e).toString(16)),z(i(r).toString(16)),z(D(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_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(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:O(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function V(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],536:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[a,i,o,s]}function a(t,e){var r=e.id,n=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(t,e){var n=r(t.transform),a=t.arcs;function i(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],i=0,o=r.length;i1)n=l(t,e,r);else for(a=0,n=new Array(i=t.arcs.length);a1)for(var i,s,c=1,u=l(a[0]);cu&&(s=a[0],a[0]=a[c],a[c]=s,u=i);return a})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[a]=2))throw new Error("n must be \u22652");var r,a=(l=t.bbox||n(t))[0],i=l[1],o=l[2],s=l[3];e={scale:[o-a?(o-a)/(r-1):1,s-i?(s-i)/(r-1):1],translate:[a,i]}}var l,c,u=h(e),f=t.objects,p={};function d(t){return u(t)}function g(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(g)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)p[c]=g(f[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,a=t.length,i=new Array(a);for(i[0]=u(t[0],0);++rMath.max(r,n)?a[2]=1:r>Math.max(e,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=t[l]*t[l],o+=a[l]*t[l];for(l=0;l<3;++l)a[l]-=o/i*t[l];return s(a,a),a}function f(t,e,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.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,n=0,a=0,i=0;i<3;++i)a+=e[i]*r[i],n+=e[i]*e[i];var l=Math.sqrt(n),u=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,u+=r[i]*r[i],e[i]/=l;var h=Math.sqrt(u);for(i=0;i<3;++i)r[i]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],m=Math.cos(d),v=Math.sin(d),y=Math.cos(g),x=Math.sin(g),b=this.computedCenter,_=m*y,w=v*y,T=x,k=-m*x,A=-v*x,M=y,S=this.computedEye,E=this.computedMatrix;for(i=0;i<3;++i){var C=_*r[i]+w*f[i]+T*e[i];E[4*i+1]=k*r[i]+A*f[i]+M*e[i],E[4*i+2]=C,E[4*i+3]=0}var L=E[1],P=E[5],I=E[9],z=E[2],O=E[6],D=E[10],R=P*D-I*O,F=I*z-L*D,B=L*O-P*z,N=c(R,F,B);R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B;for(i=0;i<3;++i)S[i]=b[i]+E[2+4*i]*p;for(i=0;i<3;++i){u=0;for(var j=0;j<3;++j)u+=E[i+4*j]*S[j];E[12+i]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;d[0]=a[2],d[1]=a[6],d[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)a[4*c]=o[c],a[4*c+1]=s[c],a[4*c+2]=l[c];i(a,a,n,d);for(c=0;c<3;++c)o[c]=a[4*c],s[c]=a[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=c(i,o,s);i/=l,o/=l,s/=l;var u=a[0],h=a[4],f=a[8],p=u*i+h*o+f*s,d=c(u-=i*p,h-=o*p,f-=s*p),g=(u/=d)*e+i*r,m=(h/=d)*e+o*r,v=(f/=d)*e+s*r;this.center.move(t,g,m,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),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,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[i],l=e[i+4],h=e[i+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),g=Math.max(f,p,d);f===g?(s=s<0?-1:1,l=h=0):d===g?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var m=c(s,l,h);s/=m,l/=m,h/=m}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*h,T=c(x-=s*w,b-=l*w,_-=h*w),k=l*(_/=T)-h*(b/=T),A=h*(x/=T)-s*_,M=s*b-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,b,_),2===i){var E=e[1],C=e[5],L=e[9],P=E*x+C*b+L*_,I=E*k+C*A+L*M;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var z=e[2],O=e[6],D=e[10],R=z*s+O*l+D*h,F=z*x+O*b+D*_,B=z*k+O*A+D*M;v=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;a(U,e);var q=U[15],H=U[12]/q,G=U[13]/q,Y=U[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-j*W,Y-V*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,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=c(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,g=d[0],m=d[1],v=d[2],y=a*g+i*m+o*v,x=c(g-=y*a,m-=y*i,v-=y*o);if(!(x<.01&&(x=c(g=i*f-o*h,m=o*l-a*f,v=a*h-i*l))<1e-6)){g/=x,m/=x,v/=x,this.up.set(t,a,i,o),this.right.set(t,g,m,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=i*v-o*m,_=o*g-a*v,w=a*m-i*g,T=c(b,_,w),k=a*l+i*h+o*f,A=g*l+m*h+v*f,M=(b/=T)*l+(_/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(M,A),C=this.angle._state,L=C[C.length-1],P=C[C.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-E),z=Math.abs(L-E),O=Math.abs(L-2*Math.PI-E);I":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":545}],547:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":553}],548:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":544,"./is":549}],549:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":543}],550:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":547}],551:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":547,"../value/is":553}],552:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":544,"./is":553}],553:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],554:[function(t,e,r){(function(e){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var u=c.DATA,h=c.BUFFER;function f(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function g(t){return new Uint16Array(p(2*t),0,t)}function m(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))h[n.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|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){f(t.buffer)},r.freeArrayBuffer=f,r.freeBuffer=function(t){h[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return g(t);case"uint32":return m(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=g,r.mallocUint32=m,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":95,buffer:108,dup:172}],555:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",f(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(p=0;p-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,l-s),n=n.replace("?px ",S())),g+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf("+"),u=r.indexOf("+"),h=c>-1?parseInt(t[1+c]):0,f=u>-1?parseInt(r[1+u]):0;h!==f&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,f-h),n=n.replace("?px ",S())),g-=.25*x*(f-h)}if(!0===o.bolds){var p=t.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!p&&d&&(n=v?n.replace("italic ","italic bold "):"bold "+n),p&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var v=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!v&&y&&(n="italic "+n),v&&!y&&(n=n.replace("italic ",""))}e.font=n}for(f=0;f",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(a,c))&&-1!==(u=r.indexOf(i,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,d=r.substr(p,u-p).indexOf(a);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function h(t,e,r,n){var a=u(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[i]:a}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,a){var i,o=v(n);return o?o[r]=a:(i=t.indexOf(n))>=0?e[i]=a:(i=t.length,e[i]=a,t[i]=n),this}))},delete___:{value:y((function(n){var a,i,o=v(n);return o?r in o&&delete o[r]:!((a=t.indexOf(n))<0)&&(i=t.length-1,t[a]=void 0,e[a]=e[i],t[a]=t[i],t.length=i,e.length=i,!0)}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof d||x();var e,n=new r,a=void 0,i=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(a||(a=new d),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new d),a.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){f||"undefined"==typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],562:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":563}],563:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],564:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":562}],565:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":245}],566:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=f[o-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(a=i.newDate(l,c,u)).add(4-(a.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=h[t-h[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=h[o.year-h[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=f[a.year-f[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=f[i.year-f[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);l=Math.round((u-c)/864e5);var p,d=h[i.year-h[0]];for(p=0;p<13;p++){var g=d&1<<12-p?30:29;if(l>13;!m||p=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":580,"object-assign":459}],569:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":580,"object-assign":459}],570:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":580,"object-assign":459}],571:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=i},{"../main":580,"object-assign":459}],572:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":580,"object-assign":459}],573:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=i},{"../main":580,"object-assign":459}],574:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=i},{"../main":580,"object-assign":459}],575:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":580,"object-assign":459}],577:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":580,"object-assign":459}],578:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":580,"object-assign":459}],579:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":580,"object-assign":459}],580:[function(t,e,r){var n=t("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new a;c.cdate=i,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":459}],581:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,h=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(p(t,n))for(;a.length1},x=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(A).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,i){for(var o=y(t,i)?n:r,s=0;s-1){p=1,d=g;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":580,"object-assign":459}],582:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":148}],583:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":582}],584:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],585:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":773,"../../plots/cartesian/constants":789,"../../plots/font_attributes":811,"./arrow_paths":584}],586:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],h=t["_"+i+"padminus"],f={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+f,g=p-f,m=3*t.startarrowsize*t.arrowwidth||0,v=m+f,y=m-f;if(c===l){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:g}),b=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(h,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(h,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":735,"../../plots/cartesian/axes":783,"./draw":591}],587:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var H=!1,G=["x","y"],Y=0;Y1)&&(tt===$?((ct=et.r2fraction(e["a"+Q]))<0||ct>1)&&(H=!0):H=!0),W=et._offset+et.r2p(e[Q]),J=.5}else"x"===Q?(X=e[Q],W=b.l+b.w*X):(X=1-e[Q],W=b.t+b.h*X),J=e.showarrow?.5:X;if(e.showarrow){lt.head=W;var ut=e["a"+Q];K=nt*V(.5,e.xanchor)-at*V(.5,e.yanchor),tt===$?(lt.tail=et._offset+et.r2p(ut),Z=K):(lt.tail=W+ut,Z=K+ut),lt.text=lt.tail+K;var ht=x["x"===Q?"width":"height"];if("paper"===$&&(lt.head=o.constrain(lt.head,1,ht-1)),"pixel"===tt){var ft=-Math.max(lt.tail-3,lt.text),pt=Math.min(lt.tail+3,lt.text)-ht;ft>0?(lt.tail+=ft,lt.text+=ft):pt>0&&(lt.tail-=pt,lt.text-=pt)}lt.tail+=st,lt.head+=st}else Z=K=it*V(J,ot),lt.text=W+K;lt.text+=st,K+=st,Z+=st,e["_"+Q+"padplus"]=it/2+Z,e["_"+Q+"padminus"]=it/2-Z,e["_"+Q+"size"]=it,e["_"+Q+"shift"]=K}if(H)z.remove();else{var dt=0,gt=0;if("left"!==e.align&&(dt=(w-v)*("center"===e.align?.5:1)),"top"!==e.valign&&(gt=(I-y)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:R+dt-1,y:R+gt}).call(c.setClipUrl,B?M:null,t);else{var mt=R+gt-d.top,vt=R+dt-d.left;U.call(h.positionText,vt,mt).call(c.setClipUrl,B?M:null,t)}N.select("rect").call(c.setRect,R,R,w,I),F.call(c.setRect,O/2,O/2,D-O,j-O),z.call(c.setTranslate,Math.round(S.x.text-D/2),Math.round(S.y.text-j/2)),L.attr({transform:"rotate("+E+","+S.x.text+","+S.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=S.x.head,h=S.y.head,f=S.x.tail+r,d=S.y.tail+n,v=S.x.text+r,y=S.y.text+n,x=o.rotationXYMatrix(E,v,y),w=o.apply2DTransform(x),M=o.apply2DTransform2(x),P=+F.attr("width"),I=+F.attr("height"),O=v-.5*P,D=O+P,R=y-.5*I,B=R+I,N=[[O,R,O,B],[O,B,D,B],[D,B,D,R],[D,R,O,R]].map(M);if(!N.reduce((function(t,e){return t^!!o.segmentsIntersect(u,h,u+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){N.forEach((function(t){var e=o.segmentsIntersect(f,d,u,h,t[0],t[1],t[2],t[3]);e&&(f=e.x,d=e.y)}));var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,q=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),H=q.append("path").attr("d","M"+f+","+d+"L"+u+","+h).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(g(H,U,e),_.annotationPosition&&H.node().parentNode&&!i){var G=u,Y=h;if(e.standoff){var W=Math.sqrt(Math.pow(u-f,2)+Math.pow(h-d,2));G+=e.standoff*(f-u)/W,Y+=e.standoff*(d-h)/W}var Z,X,J=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-G)+","+(d-Y),transform:"translate("+G+","+Y+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);Z=t.x,X=t.y,s&&s.autorange&&T(s._name+".autorange",!0),m&&m.autorange&&T(m._name+".autorange",!0)},moveFn:function(t,r){var n=w(Z,X),a=n[0]+t,i=n[1]+r;z.call(c.setTranslate,a,i),k("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),k("y",m?m.p2r(m.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&k("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&k("ay",m.p2r(m.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+E+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&xt(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?k("ax",s.p2r(s.r2p(e.ax)+t)):k("ax",e.ax+t),e.ayref===e.yref?k("ay",m.p2r(m.r2p(e.ay)+r)):k("ay",e.ay+r),xt(t,r);else{if(i)return;var a,o;if(s)a=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-l/2;a=p.align(c+t/b.w,l,0,1,e.xanchor)}if(m)o=m.p2r(m.r2p(e.y)+r);else{var u=e._ysize/b.h,h=e.y-(e._yshift+e.yshift)/b.h-u/2;o=p.align(h-r/b.h,u,0,1,e.yanchor)}k("x",a),k("y",o),s&&m||(n=p.getCursor(s?.5:a,m?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),f(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){f(z),a.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,m=e.indexOf("end")>=0,v=h.backoff*p+r.standoff,y=f.backoff*d+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(c=(l=Math.atan2(b,x))+Math.PI,v&&y&&v+y>Math.sqrt(x*x+b*b))return void P();if(v){if(v*v>x*x+b*b)return void P();var _=v*Math.cos(l),w=v*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void P();var T=y*Math.cos(l),k=y*Math.sin(l);o.x-=T,o.y-=k,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),M="";if(A1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":834,"../annotations/draw":591}],598:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>u&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var X=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));Y*=X*c.roundUp(Z/X,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Y}G.domain=[U+N,U+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var J,K=t.select("."+k.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),Q=t.select("."+k.cbaxis),$=0;function tt(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===A?(1-(U+R-N))*l.h+l.t+3+.75*n:(1-(U+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+k.cbtitle),o=i.select("text"),u=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),h?($=f.bBox(h).height)>p&&(u[1]-=($-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&($=f.bBox(o.node()).height),$){if($+=5,"top"===A)G.domain[1]-=$/l.h,u[1]*=-1;else{G.domain[0]+=$/l.h;var d=g.lineCount(o);u[1]+=(1-d)*p}i.attr("transform","translate("+u+")"),G.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-l.t)+")");var v=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).data(P);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var y=M.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?M[0]:(P[i]+P[i-1])/2,i===P.length-1?M[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)f.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=E(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?I:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+m.width/2%1)+"h"+z).call(f.lineGroupStyle,m.width,S(t),m.dash)})),Q.selectAll("g."+G._id+"tick,path").remove();var b=j+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),T=s.makeTransFn(G),C=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:Q,path:s.makeTickPath(G,b,C),transFn:T}),s.drawLabels(r,G,{vals:w,layer:Q,transFn:T,labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,a=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2+f.bBox(Q.node()).width;if((J=K.select("text")).node()&&!J.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?f.bBox(o).width:f.bBox(K.node()).right-j-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-H;t.select("."+k.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:H-B,width:Math.max(s,2),height:Math.max(c+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:j,y:H+e.ypad+("top"===A?$:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-$,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var u=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-u)+","+l.t+")");var h={},d=w[e.yanchor],g=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=c*d,h.b=c*g):(h.t=h.b=0,h.yt=e.y+e.len*d,h.yb=e.y-e.len*g);var m=w[e.xanchor],v=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*v;else{var y=s-z;h.l=y*m,h.r=y*v,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*v}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,c)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":704,"../../lib":735,"../../lib/extend":726,"../../lib/setcursor":755,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../plots/cartesian/axis_defaults":785,"../../plots/cartesian/layout_attributes":797,"../../plots/cartesian/position_defaults":800,"../../plots/plots":846,"../../registry":866,"../color":602,"../colorscale/helpers":613,"../dragelement":621,"../drawing":624,"../titles":697,"./constants":604,d3:165,tinycolor2:535}],607:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":735}],608:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":603,"./defaults":605,"./draw":606,"./has_colorbar":607}],609:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===s,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,h=e.editTypeOverride||"",f=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(f+(r={z:"z",c:"color"}[s]));var p=s+"auto",d=s+"min",g=s+"max",m=s+"mid",v=(o(f+p),o(f+d),o(f+g),{});v[d]=v[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[d]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":751,"../colorbar/attributes":603,"./scales.js":617}],610:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,h=i(u),f=!1!==h.auto,p=h.min,d=h.max,g=h.mid,m=function(){return a.aggNums(Math.min,null,l)},v=function(){return a.aggNums(Math.max,null,l)};(void 0===p?p=m():f&&(p=u._colorAx&&n(p)?Math.min(p,m()):m()),void 0===d?d=v():f&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),f&&void 0!==g&&(d-g>g-p?p=g-(d-g):d-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}},{"../../lib":735,"./helpers":613,"fast-isnumeric":237}],611:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],619:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":735}],620:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],621:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,f,p,d,g,m=t.gd,v=1,y=m._context.doubleClickDelay,x=t.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(v=Math.max(v-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},l.coverSlip=u},{"../../lib":735,"../../plots/cartesian/constants":789,"./align":618,"./cursor":619,"./unhover":622,"has-hover":413,"has-passive-events":414,"mouse-event-offset":441}],622:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":724,"../../lib/events":725,"../../lib/throttle":760,"../fx/constants":636}],623:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],624:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),f=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),m=t("../../components/fx/helpers").appendArrayPointValue,v=e.exports={};v.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);v.translatePoint(t,a,e,r)}))},v.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){v.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(v.dashLine,l,o)}))},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach((function(t){var e=y[t],r=e.n;v.symbolList.push(r,t,r+100,t+"-open"),v.symbolNames[r]=t,v.symbolFuncs[r]=e.f,e.needLine&&(v.symbolNeedLines[r]=!0),e.noDot?v.symbolNoDot[r]=!0:v.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(v.symbolNoFill[r]=!0)}));var x=v.symbolNames.length;function b(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};v.gradient=function(t,e,r,a,o,l){for(var u=o.length,h=k[a],f=new Array(u),p=0;p"+v(t);d._gradientUrlQueryParts[y]=1},v.initGradients=function(t){var e=t._fullLayout;c.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},v.pointStyle=function(t,e,r){if(t.size()){var a=v.makePointStyleFns(e);t.each((function(t){v.singlePointStyle(t,n.select(this),e,a,r)}))}},v.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var u=v.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",b(u,l))}var h,f,p,d=!1;if(t.so)p=o.outlierwidth,f=o.outliercolor,h=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(h=s.defaultLine,d=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var m=i.gradient,y=t.mgt;if(y?d=!0:y=m&&m.type,Array.isArray(y)&&(y=y[0],k[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?d=!0:x=m.color;var _=r.uid;d&&(_+="-"+t.i),v.gradient(e,a,_,y,[[0,x],[1,h]],"fill")}else s.fill(e,h);p&&s.stroke(e,f)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,u=i.opacity,h=s.opacity,f=void 0!==u,d=void 0!==h;(c.isArrayOrTypedArray(l)||f||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:d?h:p*e});var g=a.color,m=i.color,v=s.color;(m||v)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?m||e:v||e});var y=a.size,x=i.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?c||e:u||(c?e:s.addOpacity(e,p))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",b(v.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=v.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var i=n.select(this),l=o?c.extractOption(t,e,"txt","texttemplate"):c.extractOption(t,e,"tx","text");if(l||0===l){if(o){var h=e._module.formatLabels?e._module.formatLabels(t,e,s):{},f={};m(f,e,t.i);var p=e._meta||{};l=c.texttemplateString(l,h,s._d3locale,f,t,p)}var d=t.tp||e.textposition,g=S(t,e),y=a?a(t):t.tc||e.textfont.color;i.call(v.font,t.tf||e.textfont.family,g,y).text(l).call(u.convertToTspans,r).call(M,d,g,t.mrc)}else i.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(a,i),M(a,o,l,t.mrc2||t.mrc)}))}};function E(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(s*s+l*l,.25),h=(u*u*i-c*c*s)*a,f=(u*u*o-c*c*l)*a,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&h/p),2),n.round(e[1]+(p&&f/p),2)],[n.round(e[0]-(d&&h/d),2),n.round(e[1]-(d&&f/d),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(v.savedBBoxes={},P=0),r&&(v.savedBBoxes[r]=m),P++,c.extendFlat({},m)},v.setClipUrl=function(t,e,r){t.attr("clip-path",z(e,r))},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var O=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(O,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var D=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(D);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),a.attr("transform",t.join(" "))}}))}},{"../../components/fx/helpers":638,"../../constants/alignment":704,"../../constants/interactions":710,"../../constants/xmlns_namespaces":712,"../../lib":735,"../../lib/svg_text_utils":759,"../../registry":866,"../../traces/scatter/make_bubble_size_func":1157,"../../traces/scatter/subtypes":1164,"../color":602,"../colorscale":614,"./symbol_defs":625,d3:165,"fast-isnumeric":237,tinycolor2:535}],625:[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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:165}],626:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],627:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),h=0;h0;e.each((function(e){var h,f=e[0].trace,p=f.error_x||{},d=f.error_y||{};f.ids&&(h=function(t){return t.id});var g=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var m=n.select(this).selectAll("g.errorbar").data(e,h);if(m.exit().remove(),e.length){p.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(m,r.layerClipId,t),m.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(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),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var h=d.width;i="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(i+="m-"+h+",0h"+2*h),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var f=e.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var m=(p.copy_ystyle?d:p).width;i="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(i+="m0,-"+m+"v"+2*m),!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(s.duration).ease(s.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":1164,"../drawing":624,d3:165,"fast-isnumeric":237}],632:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":602,d3:165}],633:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":726,"../../plots/font_attributes":811,"./layout_attributes":643}],634:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexb[0]._length||tt<0||tt>w[0]._length)return f.unhoverRaw(t,e)}if(e.pointerX=$+b[0]._offset,e.pointerY=tt+w[0]._offset,O="xval"in e?g.flat(l,e.xval):g.p2c(b,$),D="yval"in e?g.flat(l,e.yval):g.p2c(w,tt),!a(O[0])||!a(D[0]))return o.warn("Fx.hover failed",e,t),f.unhoverRaw(t,e)}var rt=1/0;function nt(t,r){for(F=0;FY&&(X.splice(0,Y),rt=X[0].distance),v&&0!==Z&&0===X.length){G.distance=Z,G.index=!1;var f=N._module.hoverPoints(G,q,H,"closest",u._hoverlayer);if(f&&(f=f.filter((function(t){return t.spikeDistance<=Z}))),f&&f.length){var p,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];a(m.x0)&&a(m.y0)&&(p=it(m),(!K.vLinePoint||K.vLinePoint.spikeDistance>p.spikeDistance)&&(K.vLinePoint=p))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=it(x),(!K.hLinePoint||K.hLinePoint.spikeDistance>p.spikeDistance)&&(K.hLinePoint=p))}}}}}function at(t,e){for(var r,n=null,a=1/0,i=0;i1||X.length>1)||"closest"===C&&Q&&X.length>1,At=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),Mt={hovermode:C,rotateLabels:kt,bgColor:At,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},St=E(X,Mt,t);g.isUnifiedHover(C)||(!function(t,e,r){var n,a,i,o,s,l,c,u=0,h=1,f=t.size(),p=new Array(f),d=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(h=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||h*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=a;for(m.push.apply(m,v),p.splice(o+1,1),c=0,s=m.length-1;s>=0;s--)c+=m[s].dp;for(i=c/m.length,s=m.length-1;s>=0;s--)m[s].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var w=b[s],T=w.datum;T.offset=w.dp,T.del=w.del}}}(St,kt?"xa":"ya",u),L(St,kt));if(e.target&&e.target.tagName){var Et=d.getComponentMethod("annotations","hasClickToShow")(t,bt);c(n.select(e.target),Et?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,xt))return;xt&&t.emit("plotly_unhover",{event:e,points:xt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:w,xvals:O,yvals:D})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:i,outerContainer:o},l=E(a,s,e.gd),c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e,r){var a=r._fullLayout,i=e.hovermode,s=e.rotateLabels,c=e.bgColor,f=e.container,p=e.outerContainer,d=e.commonLabelOpts||{},b=e.fontFamily||m.HOVERFONT,_=e.fontSize||m.HOVERFONTSIZE,w=t[0],T=w.xa,S=w.ya,E="y"===i.charAt(0)?"yLabel":"xLabel",L=w[E],P=(String(L)||"").split(" ")[0],I=p.node().getBoundingClientRect(),z=I.top,O=I.width,D=I.height,R=void 0!==L&&w.distance<=e.hoverdistance&&("x"===i||"y"===i);if(R){var F,B,N=!0;for(F=0;Fa.width-E?(v=a.width-E,s.attr("d","M"+(E-k)+",0L"+E+","+M+k+"v"+M+(2*A+x.height)+"H-"+E+"V"+M+k+"H"+(E-2*k)+"Z")):s.attr("d","M0,0L"+k+","+M+k+"H"+(A+x.width/2)+"v"+M+(2*A+x.height)+"H-"+(A+x.width/2)+"V"+M+k+"H-"+k+"Z")}else{var C,P,I;"right"===S.side?(C="start",P=1,I="",v=T._offset+T._length):(C="end",P=-1,I="-",v=T._offset),y=S._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),s.attr("d","M0,0L"+I+k+","+k+"V"+(A+x.height/2)+"h"+I+(2*A+x.width)+"V-"+(A+x.height/2)+"H"+I+k+"V-"+k+"Z");var O,D=x.height/2,R=z-x.top-D,F="clip"+a._uid+"commonlabel"+S._id;if(v=0?$-=rt:$+=2*A;var nt=et.height+2*A,at=Q+nt>=D;return nt<=D&&(Q<=z?Q=S._offset+2*A:at&&(Q=D-nt)),tt.attr("transform","translate("+$+","+Q+")"),tt}var it=f.selectAll("g.hovertext").data(t,(function(t){return M(t)}));return it.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(h.fill,h.addOpacity(c,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,b,_)})),it.exit().remove(),it.each((function(t){var e=n.select(this).attr("transform",""),o=t.bgcolor||t.color,f=h.combine(h.opacity(o)?o:h.defaultLine,c),p=h.combine(h.opacity(t.color)?t.color:h.defaultLine,c),d=t.borderColor||h.contrast(f),g=C(t,R,i,a,L,e),m=g[0],v=g[1],y=e.select("text.nums").call(u.font,t.fontFamily||b,t.fontSize||_,t.fontColor||d).text(m).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),w=e.select("text.name"),T=0,M=0;if(v&&v!==m){w.call(u.font,t.fontFamily||b,t.fontSize||_,p).text(v).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var S=w.node().getBoundingClientRect();T=S.width+2*A,M=S.height+2*A}else w.remove(),e.select("rect").remove();e.select("path").style({fill:f,stroke:d});var E,P,I=y.node().getBoundingClientRect(),F=t.xa._offset+(t.x0+t.x1)/2,B=t.ya._offset+(t.y0+t.y1)/2,N=Math.abs(t.x1-t.x0),j=Math.abs(t.y1-t.y0),V=I.width+k+A+T;if(t.ty0=z-I.top,t.bx=I.width+2*A,t.by=Math.max(I.height+2*A,M),t.anchor="start",t.txwidth=I.width,t.tx2width=T,t.offset=0,s)t.pos=F,E=B+j/2+V<=D,P=B-j/2-V>=0,"top"!==t.idealAlign&&E||!P?E?(B+=j/2,t.anchor="start"):t.anchor="middle":(B-=j/2,t.anchor="end");else if(t.pos=B,E=F+N/2+V<=O,P=F-N/2-V>=0,"left"!==t.idealAlign&&E||!P)if(E)F+=N/2,t.anchor="start";else{t.anchor="middle";var U=V/2,q=F+U-O,H=F-U;q>0&&(F-=q),H<0&&(F+=-H)}else F-=N/2,t.anchor="end";y.attr("text-anchor",t.anchor),T&&w.attr("text-anchor",t.anchor),e.attr("transform","translate("+F+","+B+")"+(s?"rotate("+x+")":""))})),it}function C(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=O(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var c=n._d3locale,u=t.hovertemplate||!1,h=t.hovertemplateLabels||t,f=t.eventData[0]||{};return u&&(l=(l=o.hovertemplateString(u,h,c,f,t.trace._meta)).replace(S,(function(e,r){return s=O(r,t.nameLength),""}))),[l,s]}function L(t,e){t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),i=t.anchor,o="end"===i?-1:1,s={start:1,end:-1,middle:0}[i],c=s*(k+A),h=c+s*(t.txwidth+A),f=0,p=t.offset;"middle"===i&&(c-=t.tx2width/2,h+=t.txwidth/2+A),e&&(p*=-T,f=t.offset*w),r.select("path").attr("d","middle"===i?"M-"+(t.bx/2+t.tx2width/2)+","+(p-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*k+f)+","+(k+p)+"v"+(t.by/2-k)+"h"+o*t.bx+"v-"+t.by+"H"+(o*k+f)+"V"+(p-k)+"Z");var d=c+f,g=p+t.ty0-t.by/2+A,m=t.textAlign||"auto";"auto"!==m&&("left"===m&&"start"!==i?(a.attr("text-anchor","start"),d="middle"===i?-t.bx/2-t.tx2width/2+A:-t.bx-A):"right"===m&&"end"!==i&&(a.attr("text-anchor","end"),d="middle"===i?t.bx/2-t.tx2width/2-A:t.bx+A)),a.call(l.positionText,d,g),t.tx2width&&(r.select("text.name").call(l.positionText,h+s*A+f,p+t.ty0-t.by/2+A),r.select("rect").call(u.setRect,h+(s-1)*t.tx2width/2+f,p-t.by/2-1,t.tx2width,t.by+2))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var a=c(r,n);l(a)&&(t[e]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function I(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,f=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||f){var g=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(f){var m,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(m=c.pointerX,v=c.pointerY):(m=n._offset+y.x,v=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?h.contrast(g):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,A=p.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=m),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":u.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(d){var E,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(E=c.pointerX,C=c.pointerY):(E=n._offset+L.x,C=a._offset+L.y);var P,I,z=i.readability(L.color,g)<1.5?h.contrast(g):L.color,O=n.spikemode,D=n.spikethickness,R=n.spikecolor||z,F=p.getPxPosition(t,n);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(P=F,I=C),-1!==O.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":u.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function z(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function O(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":735,"../../lib/events":725,"../../lib/override_cursor":746,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../registry":866,"../color":602,"../dragelement":621,"../drawing":624,"../legend/defaults":654,"../legend/draw":655,"./constants":636,"./helpers":638,d3:165,"fast-isnumeric":237,tinycolor2:535}],640:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":735,"../color":602,"./helpers":638}],641:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,s=i("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!f&&!p&&!d)"independent"===k("pattern")&&(f=!0);m._hasSubplotGrid=f;var x,b,_="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),m._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,m,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,u,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,g=r.rows,m=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var m=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var v,y,x,b=_("orientation");"h"===b?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),_("traceorder",f),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",v),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,m,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(c,m,o,t,e)}}},{"../../lib":735,"../../plot_api/plot_template":773,"../../plots/layout_attributes":837,"../../registry":866,"./attributes":652,"./helpers":658}],655:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),h=t("../../lib/svg_text_utils"),f=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),g=d.LINE_SPACING,m=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){f(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&f(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],s=i.trace,l=o.traceIs(s,"pie-like"),u=s.index,f=r._main&&e._context.edits.legendText&&!l,d=r._maxNameLength;r.entries?n=i.text:(n=l?i.label:s.name,s._meta&&(n=a.templateString(n,s._meta)));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(f?T(n,d):n),h.positionText(g,p.textGap,0),f?g.call(h.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var s=i.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var c=o.getTransformIndices(s,"groupby"),h=c[c.length-1],f=a.keyedContainer(s,"transforms["+h+"].styles","target","value.name");f.set(i.trace._group,n),l=f.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,u)})):A(g,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")}));s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}}))}function A(t,e,r,n){n._main||t.attr("data-notex",!0),h.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var f=c.bBox(i);o=f.height,s=f.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,l,.75*o+l)}else{var d=t.select(n?".legendtext":".legendtitletext"),m=h.lineCount(d),v=d.node();o=u*m,s=v?c.bBox(v).width:0;var y=u*((m-1)/2-.3);n?h.positionText(d,p.textGap,-y):h.positionText(d,p.titlePad+l,u+l)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function S(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,h="legend"+s._uid;if(e?(r=e.layer,h+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var f;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;f=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;f=y(e.entries,e)}var d=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!f.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=a.ensureSingleById(s._topdefs,"clipPath",h,(function(t){t.append("rect")})),E=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));E.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,L.font).text(L.text),A(P,C,t,e)}else C.selectAll(".legendtitletext").remove();var I=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(f);z.enter().append("g").attr("class","groups"),z.exit().remove();var O=z.selectAll("g.traces").data(a.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){e._main&&n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=b.isVertical(a),l=b.isGrouped(a),u=a.borderwidth,h=2*u,f=p.textGap,d=p.itemGap,g=2*(u+d),m=S(a),v=a.y<0||0===a.y&&"top"===m,y=a.y>1||1===a.y&&"bottom"===m;a._maxHeight=Math.max(v||y?i.height/2:o.h,30);var x=0;a._width=0,a._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),x=f+a._width,a._width+=d+f+h,a._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,A=y||v,E=i.width/2;a._maxWidth=Math.max(T?A&&"left"===w?o.l+o.w:E:k?A&&"right"===w?o.r+o.w:E:o.w,2*f);var C=0,L=0;r.each((function(t){var e=t[0].width+f;C=Math.max(C,e),L+=e})),x=null;var P=0;if(l){var I=0,z=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+d+n/2+e),e+=n,t=Math.max(t,f+r[0].width)})),I=Math.max(I,e);var r=t+d;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,O+=I+a.tracegroupgap,I=e),c.setTranslate(this,z,O),z+=r})),a._width=Math.max(P,z)+u,a._height=O+I+g}else{var D=r.size(),R=L+h+(D-1)*da._maxWidth&&(P=Math.max(P,j),B=0,N+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+B,_[1]+u+N+e/2+d),j=B+r+d,B+=n,F=Math.max(F,e)})),R?(a._width=B+h,a._height=F+g):(a._width=Math.max(P,j)+h,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=t._context.edits,U=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=U?f:x||f+t[0].width;s||(a+=d/2),c.setRect(e,0,-r/2,a,r)}))}(t,z,O,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*m[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*m[n]})}(t)){var u,f,d,y,x=s._size,b=e.borderwidth,w=x.l+x.w*e.x-m[M(e)]*e._width,k=x.t+x.h*(1-e.y)-m[S(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var A=w,L=k;w=a.constrain(w,0,s.width-e._width),k=a.constrain(k,0,s.height-e._effHeight),w!==A&&a.log("Constrain legend.x to make legend fit inside graph"),k!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&c.setTranslate(g,w,k),I.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var P=e._effHeight;e._main||(P=e._height),E.attr({width:e._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:e._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,h,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var z,O,D,R=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*p.scrollBarMargin,B=e._height-e._effHeight,N=F/B,j=Math.min(e._scrollY||0,B);E.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+j}),c.setClipUrl(C,h,t),q(j,R,N),g.on("wheel",(function(){q(j=a.constrain(e._scrollY+n.event.deltaY/F*B,0,B),R,N),0!==j&&j!==B&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,D=j})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(j=function(t,e,r){var n=(r-e)/N+t;return a.constrain(n,0,B)}(D,z,O),R,N))}));I.call(V);var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,D=j)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,q(j=function(t,e,r){var n=(e-r)/N+t;return a.constrain(n,0,B)}(D,z,O),R,N))}));C.call(U)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=c.getTranslate(g);d=t.x,y=t.y},moveFn:function(t,r){var n=d+t,a=y+r;c.setTranslate(g,n,a),u=l.align(n,0,x.l,x.l+x.w,e.xanchor),f=l.align(a,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==u&&void 0!==f&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":f})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function q(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,e._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],t)}}},{"../../constants/alignment":704,"../../lib":735,"../../lib/events":725,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../../registry":866,"../color":602,"../dragelement":621,"../drawing":624,"./constants":653,"./get_legend_data":656,"./handle_click":657,"./helpers":658,"./style":660,d3:165}],656:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,c={},u=0,h=0,f=e._main;function p(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;s.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=e.width}return d?n:Math.min(a,r)};function m(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(c?[t]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each((function(t){var e=n.select(this),r=t[0],a=g(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function v(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var f=(s.marker||{}).line,p=g(h(f.width,o.pts),f,5,2),d=i.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=f.color;var m=i.minExtend(o,{trace:d});u(c,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var c={top:1,bottom:-1}[o]*(.5*(s-l+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([t]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=n.select(this),p=l(a),d=p.colorscale,g=p.reversescale;if(d){if(!r){var m=d.length;u=0===c?d[g?m-1:0][1]:1===c?d[g?0:m-1][1]:d[Math.floor((m-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[c]||v[0]:v}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var n="legendfill-"+a.uid;o.gradient(t,e,n,f(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,m(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=g(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){m(t,this,"funnel")})).each((function(t){m(t,this)})).each((function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=g(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:d?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){v(t,this,"funnelarea")})).each((function(t){v(t,this,"pie")})).each((function(t){var r,a,s=t[0],u=s.trace,h=u.visible&&u.fill&&"none"!==u.fill,p=c.hasLines(u),d=u.contours,m=!1,v=!1,y=l(u),x=y.colorscale,b=y.reversescale;if(d){var _=d.coloring;"lines"===_?m=!0:p="none"===_||"heatmap"===_||d.showlines,"constraint"===d.type?h="="!==d._operation:"fill"!==_&&"heatmap"!==_||(v=!0)}var w=c.hasMarkers(u)||c.hasText(u),T=h||v,k=p||m,A=w||!T?"M5,0":k?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(h||v?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h30v6h-30z").call(h?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,f(b),x,"fill")}}),p||m){var E=g(void 0,u.line,10,5);a=i.minExtend(u,{line:{width:E}}),r=[i.minExtend(s,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(p||m?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(m?"l30,0.0001":"h30")).call(p?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,f(b),x,"stroke")}})})).each((function(t){var r,a,s=t[0],l=s.trace,u=c.hasMarkers(l),h=c.hasText(l),f=c.hasLines(l);function p(t,e,r,n){var a=i.nestedProperty(l,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(d&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function g(t){return s._distinct&&s.index&&t[s.index]?t[s.index]:t[0]}if(u||h||f){var m={},v={};if(u){m.mc=p("marker.color",g),m.mx=p("marker.symbol",g),m.mo=p("marker.opacity",i.mean,[.2,1]),m.mlc=p("marker.line.color",g),m.mlw=p("marker.line.width",i.mean,[0,5],2),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);m.ms=y,v.marker.size=y}f&&(v.line={width:p("line.width",g,[0,10],5)}),h&&(m.tx="Aa",m.tp=p("textposition",g),m.ts=10,m.tc=p("textfont.color",g),m.tf=p("textfont.family",g)),r=[i.minExtend(s,m)],(a=i.minExtend(l,v)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var _=x.selectAll("g.pointtext").data(h?r:[]);_.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),_.exit().remove(),_.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=g(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],l=g(void 0,i.line,5,2);a.style("fill","none").call(o.dashLine,i.line.dash,l),l&&s.stroke(a,i.line.color)}))}))}},{"../../lib":735,"../../registry":866,"../../traces/pie/helpers":1119,"../../traces/pie/style_one":1125,"../../traces/scatter/subtypes":1164,"../color":602,"../colorscale/helpers":613,"../drawing":624,d3:165}],661:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function h(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=i.list(t,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,g=(1+d)/2,m=(1-d)/2;for(a=0;a1?(E=["toggleHover"],C=["resetViews"]):d?(S=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],C=["resetGeo"]):p?(E=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(S=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],C=["resetViewMapbox"]):v?E=["hoverClosestGl2d"]:g?E=["hoverClosestPie"]:_?(E=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):E=["toggleHover"];f&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=R[r+1];else if(t=n.pmax)e=R[r+1];else if(t0?f+c:c;return{ppad:c,ppadplus:u?d:g,ppadminus:u?g:d}}return{ppad:c}}function u(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,h,f=1/0,p=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=h)));return p>=f?[f,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=h,E="y0",A=y,C="y1"):(k=y,E="y1",A=h,C="y0");W(n),J(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Y.moveFn="move"===z?Z:X,Y.altKey=n.altKey},doneFn:function(){if(v(t))return;p(e),K(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;K(s)}};function W(r){if(v(t))z=null;else if(R)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Y.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-s/i):"move";p(e,l),z=l.split("-")[0]}}function Z(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;O?B("xanchor",r.xanchor=q(x+n)):(o=function(t){return q(V(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=H(T+a)):(l=function(t){return H(U(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else O?B("xanchor",r.xanchor=q(x+n)):(B("x0",r.x0=q(c+n)),B("x1",r.x1=q(m+n))),D?B("yanchor",r.yanchor=H(T+a)):(B("y0",r.y0=H(h+a)),B("y1",r.y1=H(y+a)));e.attr("d",_(t,r)),J(s,r)}function X(n,a){if(F){var i=function(t){return t},o=i,l=i;O?B("xanchor",r.xanchor=q(x+n)):(o=function(t){return q(V(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=H(T+a)):(l=function(t){return H(U(t)+a)},j&&"date"===j.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===z){var u=c+n,f=D?h-a:h+a;B("x0",r.x0=O?u:q(u)),B("y0",r.y0=D?f:H(f))}else if("resize-over-end-point"===z){var p=m+n,d=D?y-a:y+a;B("x1",r.x1=O?p:q(p)),B("y1",r.y1=D?d:H(d))}}else{var v=function(t){return-1!==z.indexOf(t)},b=v("n"),G=v("s"),Y=v("w"),W=v("e"),Z=b?k+a:k,X=G?A+a:A,K=Y?M+n:M,Q=W?S+n:S;D&&(b&&(Z=k-a),G&&(X=A-a)),(!D&&X-Z>10||D&&Z-X>10)&&(B(E,r[E]=D?Z:H(Z)),B(C,r[C]=D?X:H(X))),Q-K>10&&(B(L,r[L]=O?K:q(K)),B(P,r[P]=O?Q:q(Q)))}e.attr("d",_(t,r)),J(s,r)}function J(t,e){(O||D)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(O?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,d.paramIsX))),o=U(D?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,d.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),O&&D){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(O){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}f.init(Y),G.node().onmousemove=W}(t,O,l,e,r,z):!0===l.editable&&O.style("pointer-events",P||c.opacity(S)*M<=.5?"stroke":"all");O.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,m(t)}}(t,O)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,c,u,h,f=e.type,p=i.getFromId(t,e.xref),m=i.getFromId(t,e.yref),v=t._fullLayout._size;if(p?(r=g.shapePositionToRange(p),n=function(t){return p._offset+p.r2p(r(t,!0))}):n=function(t){return v.l+v.w*t},m?(o=g.shapePositionToRange(m),s=function(t){return m._offset+m.r2p(o(t,!0))}):s=function(t){return v.t+v.h*(1-t)},"path"===f)return p&&"date"===p.type&&(n=g.decodeDate(n)),m&&"date"===m.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],h=d.paramIsY[c],f=d.numParams[c],p=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===i?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,c=y+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);u=x-e.y0,h=x-e.y1}else u=s(e.y0),h=s(e.y1);if("line"===f)return"M"+l+","+u+"L"+c+","+h;if("rect"===f)return"M"+l+","+u+"H"+c+"V"+h+"H"+l+"Z";var b=(l+c)/2,_=(u+h)/2,w=Math.abs(b-l),T=Math.abs(_-u),k="A"+w+","+T,A=b+w+","+_;return"M"+A+k+" 0 1,1 "+(b+","+(_-T))+k+" 0 0,1 "+A+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&h(v),r.attr("d",g(e)),A&&!f)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function S(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=s.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+u.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+u.groupClassName).data(r,m);l.enter().append("g").classed(u.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform","translate("+m+")")}}}return O.call(D),I&&(S?O.on(".opacity",null):(k=0,A=!0,O.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),O.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==y?o.call("_guiRestyle",t,m,e,y):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(D)})).on("input",(function(t){this.text(t||" ").call(u.positionText,b.x,b.y)}))),O.classed("js-placeholder",A),w}}},{"../../constants/alignment":704,"../../constants/interactions":710,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../../registry":866,"../color":602,"../drawing":624,d3:165,"fast-isnumeric":237}],698:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plot_api/plot_template":773,"../../plots/font_attributes":811,"../../plots/pad_attributes":845,"../color/attributes":601}],699:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],700:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":735,"../../plots/array_container_defaults":779,"./attributes":698,"./constants":699}],701:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,h=t("./constants"),f=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,c(t.layout,h.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(a.attr(h.menuIndexAttrName,"-1"),m(t,n,a,i,e),s||v(t,n,a,i,e))}function m(t,e,r,n,a){var i=s.ensureSingle(e,"g",h.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,c=a.active,u=a.buttons[c]||h.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};i.call(y,a,u,t).call(M,a,f,p),s.ensureSingle(e,"text",h.headerArrowClassName,(function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(h.arrowSymbol[a.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+a.pad.l,y:l.headerHeight/2+h.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),v(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?h.dropdownButtonClassName:h.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,m=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=v.headerHeight+h.gapButtonHeader:d=v.headerWidth+h.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-h.gapButtonHeader+h.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-h.gapButtonHeader+h.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+m+o.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(M,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,s,l,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+h.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+h.headerGroupClassName).data(r,p);l.enter().append("g").classed(h.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",h.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=m+v;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,z=d+g,O=m;z+P>l&&(z=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:O,width:P,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?h+P+.5:h+.5,N=f-.5,j=k?p+M+.5:p+.5,V=o._topdefs.selectAll("#"+R).data(k||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),k||L?(this._clipRect=V.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||L){var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),L&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":735,"../color":602,"../drawing":624,d3:165}],704:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],705:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],706:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],707:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],708:[function(t,e,r){"use strict";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]}},{}],709:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],710:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],711:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],712:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],713:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],716:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],717:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return i(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function h(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,h,f,p,d,g=l([r,n]);function m(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,h=o,f=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return h(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return h(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return h(t,e,r,n,a,i,1)}}},{"./mod":742}],718:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var L;k=Number(k);try{var P=m.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),L=P.newDate(k,P.toMonthIndex(k,A,I),M)}else L=P.newDate(k,Number(A),M)}catch(t){return u}return L?(L.toJD()-g)*h+S*f+E*p+C*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?u:z.getTime()+C*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*h,k=3*f,A=5*p;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/h)+g,E=Math.floor(l(t,h));try{i=m.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+h&&t<=a-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function E(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=m.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/f),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+E(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return E(e,t,n,a)};var L=3*h;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var a=Math.round(t/h)+g,i=m.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+L);return c.setUTCMonth(c.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,c=_(e)&&m.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=f.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(f.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||g<0||g>1?null:{x:t+l*g,y:e+h*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(s(t,e,r,n,a,i,o,c))return 0;var u=r-t,h=n-e,f=o-a,p=c-i,d=u*u+h*h,g=f*f+p*p,m=Math.min(l(u,h,d,a-t,i-e),l(u,h,d,o-t,c-e),l(f,p,g,t-a,e-i),l(f,p,g,r-a,n-i));return Math.sqrt(m)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(o(r,e)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=a:f=a,h++}return i}},{"./mod":742}],732:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=i(s);function u(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return c;var e=i(t);return e.length?e:c}function f(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,p,d,g=t.color,m=l(g),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):h,a=m?function(t,e){return void 0===t[e]?c:i(n(t[e]))}:h,s=v?function(t,e){return void 0===t[e]?1:f(t[e])}:f,m||v)for(var b=0;bo?s:a(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*c[n];u[r]=i}return u},l.syncOrAsync=function(t,e,r){var n;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,n){var a;return C.test(n)?a=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,a=r[n]()),l.isValidTextValue(a)?a:""}))};var L={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return z.apply(L,arguments)};var P={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return z.apply(P,arguments)};var I=/^[:|\|]/;function z(t,e,r){var a=this,i=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,(function(t,s,c){var u,h,f,p;for(f=3;f=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(a=10*a+s-48),!l||!c){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var O=2e9;l.seedPseudoRandom=function(){O=2e9},l.pseudoRandom=function(){var t=O;return O=(69069*O+1)%4294967296,Math.abs(O-t)<429496729?l.pseudoRandom():O/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(a))return n(a);var i=l.extractOption(t,e,"tx","text");return l.isValidTextValue(i)?n(i):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+s))+")"+(c<1?"scale("+c+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":711,"./anchor_utils":716,"./angles":717,"./array":718,"./clean_number":719,"./clear_responsive":721,"./coerce":722,"./dates":723,"./dom":724,"./extend":726,"./filter_unique":727,"./filter_visible":728,"./geometry2d":731,"./identity":734,"./is_plain_object":736,"./keyed_container":737,"./localize":738,"./loggers":739,"./make_trace_groups":740,"./matrix":741,"./mod":742,"./nested_property":743,"./noop":744,"./notifier":745,"./push_unique":749,"./regex":751,"./relative_attr":752,"./relink_private":753,"./search":754,"./stats":757,"./throttle":760,"./to_log_range":761,d3:165,"fast-isnumeric":237}],736:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],737:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":771,"./notifier":745}],740:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:165}],741:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],743:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;li||c===a||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===a||li||c===a||cs)return!1;var u,h,f,p,d,g=r.length,m=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,m)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":711,"./matrix":741}],748:[function(t,e,r){(function(r){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":756,regl:499}],749:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,h=0,f=e.length,p=0,d=f>1?(e[f-1]-e[0])/(f-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);h90&&a.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(i=Math.min(i,h),l.push(u),a=u)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":718,"fast-isnumeric":237}],758:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":122}],759:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var M=t.text(),E=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),E?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(E[2],i,(function(n,a,i){C.selectAll("svg."+L).remove(),C.selectAll("g."+L+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void e();var l=C.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:L,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var h=s(u,"width"),f=s(u,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===L[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-h/2,d-f/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?o.attr({x:t.attr("x"),y:d-f/2}):"a"===L[0]&&0!==L.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:p,y:+t.attr("y")+d-f/2}),A&&A.call(t,l),e(l)}))}))):P(),t}function P(){C.empty()||(L=t.attr("class")+"-math",C.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,s=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}y.test(e)?u():(r=t,l=[{node:t}]);for(var C=e.split(m),L=0;L|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,_=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,w=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,c=0;ca?o.push(u.substr(0,d-a)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function E(t,e,r){var n,a,i,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},i="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:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],761:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":237}],762:[function(t,e,r){"use strict";var n=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,i=t("topojson-client").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=a[t.locationmode],n=e.objects[r];return i(e,n).features}},{"../plots/geo/constants":813,"topojson-client":538}],763:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],764:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],765:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,f=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!g&&(f(m,v),p(t),!0)}var x,b,_,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),C=E||[],L=u(v,h).get(),P=[],I=-1,z=C.length;for(x=0;xC.length-(A?0:1))i.warn("index out of range",h,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?P.push(_):A?("add"===k&&(k={}),C.splice(_,0,k),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)C.splice(P[x],1),L&&L.splice(P[x],1);if(C.length?E||e.set(C):e.set(null),g)return!1;if(f(m,v),d!==a){var O;if(-1===I)O=S;else{for(z=Math.max(C.length,z),O=[],x=0;x=I);x++)O.push(_);for(x=I;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(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]),z(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,c,u,h,f=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=X(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[f.previousPromises];i.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(H(t,i,a)||f.supplyDefaults(t),i.legend&&s.push(k.doLegend),i.layoutstyle&&s.push(k.layoutStyles),i.axrange&&G(s,a.rangesAltered),i.ticks&&s.push(k.doTicksRelayout),i.modebar&&s.push(k.doModeBar),i.camera&&s.push(k.doCamera),i.colorbars&&s.push(k.doColorBars),s.push(E)),s.push(f.rehover,f.redrag),c.add(t,q,[t,a.undoit],q,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==i){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(t,e){var r,n,a,i=t.layout,l=t._fullLayout,c=l._guiEditing,f=N(l._preGUI,c),p=Object.keys(e),g=d.list(t),m=o.extendDeepAll({},e),v={};for(U(e),p=Object.keys(e),n=0;n0&&"string"!=typeof z.parts[D];)D--;var R=z.parts[D],F=z.parts[D-1]+"."+R,j=z.parts.slice(0,D).join("."),V=s(t.layout,j).get(),q=s(l,j).get(),H=z.get();if(void 0!==O){k[I]=O,S[I]="reverse"===R?O:B(H);var G=h.getLayoutValObject(l,z.parts);if(G&&G.impliedEdits&&null!==O)for(var X in G.impliedEdits)E(o.relativeAttr(I,X),G.impliedEdits[X]);if(-1!==["width","height"].indexOf(I))if(O){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",O?null:l.width),E("height",O?null:l.height);else if(F.match(Y))P(F),s(l,j+"._inputRange").set(null);else if(F.match(W)){P(F),s(l,j+"._inputRange").set(null);var Q=s(l,j).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(Z)&&s(l,j+"._inputDomain").set(null);if("type"===R){var $=V,tt="linear"===q.type&&"log"===O,et="log"===q.type&&"linear"===O;if(tt||et){if($&&$.range)if(q.autorange)tt&&($.range=$.range[1]>$.range[0]?[1,2]:[2,1]);else{var rt=$.range[0],nt=$.range[1];tt?(rt<=0&&nt<=0&&E(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),E(j+".range[0]",Math.log(rt)/Math.LN10),E(j+".range[1]",Math.log(nt)/Math.LN10)):(E(j+".range[0]",Math.pow(10,rt)),E(j+".range[1]",Math.pow(10,nt)))}else E(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete l[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,O,E),u.getComponentMethod("images","convertCoords")(t,q,O,E)}else E(j+".autorange",!0),E(j+".range",null);s(l,j+"._inputRange").set(null)}else if(R.match(M)){var at=s(l,I).get(),it=(O||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,E),u.getComponentMethod("images","convertCoords")(t,at,it,E)}var ot=w.containerArrayMatch(I);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(O)?S[I]=null:w.isRemoveVal(O)?S[I]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(_,lt),v[r]||(v[r]={});var ct=v[r][n];ct||(ct=v[r][n]={}),ct[st]=O,delete e[I]}else"reverse"===R?(V.range?V.range.reverse():(E(j+".autorange",!0),V.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==H&&"select"!==H||l._has("gl2d")?_.plot=!0:G?A.update(_,G):_.calc=!0,z.set(O))}}for(r in v){w.applyContainerArrayChanges(t,f(i,r),v[r],_,f)||(_.plot=!0)}var ut=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function h(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&h()};e()}var d,g,m=0;function v(t){return Array.isArray(a)?m>=a.length?t.transitionOpts=a[m]:t.transitionOpts=a[0]:t.transitionOpts=a,m++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,m=(u[g]||d[g]||{}).name,v=e[n].name,y=u[m]||d[m];m&&v&&"number"==typeof v&&y&&S<5&&(S++,o.warn('addFrames: overwriting frame "'+(u[m]||d[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[g]={name:g},p.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=f.modifyFrames,u=f.modifyFrames,h=[t,s],p=[t,i];return c&&c.add(t,l,h,u,p),f.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],u=r.deleteTraces,h=t,f=[e,l],p=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=u[o];else{var h=t._module;if(h||(h=(n.modules[t.type||i.type.dflt]||{})._module),!h)return!1;if(!(a=(r=h.attributes)&&r[o])){var f=h.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return b(a,e,s)},r.getLayoutValObject=function(t,e){return b(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function h(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:h,applyUpdate:function(e,r){e&&u(e,r);var a=h();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":735,"../plots/attributes":780}],774:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),h=t("../components/modebar"),f=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),g=d.enforce,m=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function x(t){var e,a,s,u,d,g,m=t._fullLayout,v=m._size,x=v.p,_=f.list(t,"",!0);if(m._paperdiv.style({width:t._context.responsive&&m.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":m.width+"px",height:t._context.responsive&&m.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),t._context.setBackground(t,m.paper_bgcolor),r.drawMainTitle(t),h.manage(t),!m._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var A=[],M=[],S=[],E=1===l.opacity(m.paper_bgcolor)&&1===l.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(a in m._plots)if((s=m._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,L=s.yaxis.domain,P=s.plotgroup;if(y(C,L,S)){var I=P.node(),z=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(z.node(),I.childNodes[0]),M.push(a)}else P.select("rect.bg").remove(),S.push([C,L]),E||(A.push(a),M.push(a))}var O,D,R,F,B,N,j,V,U,q,H,G,Y,W=m._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){m._plots[t].bg=n.select(this)})),e=0;eT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&m(i)&&t(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":735,"../plots/attributes":780,"../plots/plots":846,"./plot_config":771,"./plot_schema":772,"./plot_template":773}],776:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,h={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,f,p,d;function g(t){return!(t in e)||o.validate(e[t],h[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),f=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var m={};function v(t,r){return o.coerce(e,m,h,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},f);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),b?A.height=b:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,h=k._fullLayout.height;function f(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),t(T?p:s.encodeJSON(p))}if(f(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:h,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,A,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":735,"../plots/plots":846,"../snapshot/helpers":870,"../snapshot/svgtoimg":872,"../snapshot/tosvg":874,"../version":1322,"./plot_api":770,"fast-isnumeric":237}],777:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var h=Object.keys(t),f=0;fx.length&&a.push(d("unused",i,v.concat(x.length)));var A,M,S,E,C,L=x.length,P=Array.isArray(k);if(P&&(L=Math.min(L,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&a.push(d("unused",i,v.concat(M,x[M].length)));var I=x[M].length;for(A=0;A<(P?Math.min(I,k[M].length):I);A++)S=P?k[M][A]:k,E=y[M][A],C=x[M][A],n.validate(E,S)?C!==E&&C!==+E&&a.push(d("dynamic",i,v.concat(M,A),E,C)):a.push(d("value",i,v.concat(M,A),E))}else a.push(d("array",i,v.concat(M),y[M]));else for(M=0;M1&&p.push(d("object","layout"))),a.supplyDefaults(g);for(var m=g._fullData,v=r.length,y=0;y0&&((b=A-o(m)-o(v))>M?_/b>E&&(y=m,x=v,E=_/b):_/A>E&&(y={val:m.val,pad:0},x={val:v.val,pad:0},E=_/A));if(f===p){var C=f-1,L=f+1;if(T)if(0===f)i=[0,1];else{var P=(f>0?h:u).reduce((function(t,e){return Math.max(t,o(e))}),0),I=f/(1-Math.min(.5,P/A));i=f>0?[0,I]:[I,0]}else i=k?[Math.max(0,C),Math.max(1,L)]:[C,L]}else T?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):k&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),E=(x.val-y.val-S(m.val,v.val))/(A-o(y)-o(x)),i=[y.val-E*o(y),x.val+E*o(x)];return d&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function c(t,e){var r,n,a,i=e._id,o=t._fullData,s=t._fullLayout,l=[],c=[];function f(t,e){for(r=0;r=r&&(c.extrapad||!o)){s=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function p(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var l=i.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,s,l,c,f,d,g,m,v=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(g=1/0,m=-1/0,w)for(a=0;a0&&(g=o),o>m&&o-i&&(g=o),o>m&&o=I;a--)P(a);return{min:v,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":711,"../../lib":735,"../../registry":866,"fast-isnumeric":237}],783:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),p=t("./clean_ticks"),d=t("../../constants/numerical"),g=d.ONEAVGYEAR,m=d.ONEAVGMONTH,v=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=d.MINUS_SIGN,w=d.BADNUM,T=t("../../constants/alignment"),k=T.MID_SHIFT,A=T.CAP_SHIFT,M=T.LINE_SPACING,S=T.OPPOSITE_SIDE,E=e.exports={};E.setConvert=t("./set_convert");var C=t("./axis_autotype"),L=t("./axis_ids");E.id2name=L.id2name,E.name2id=L.name2id,E.cleanId=L.cleanId,E.list=L.list,E.listIds=L.listIds,E.getFromId=L.getFromId,E.getFromTrace=L.getFromTrace;var P=t("./autorange");E.getAutoRange=P.getAutoRange,E.findExtremes=P.findExtremes;function I(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}E.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=l[0]||i),i||(i=a),u[c]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},s.coerce(t,e,u,c)},E.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(a,i);else{var c=E.getFromId(e,n);l=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(l)},E.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:E.getFromId(e,r).cleanPos)(t)},E.redrawComponents=function(t,e){e=e||E.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.saveRangeInitial=function(t,e){for(var r=E.list(t,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=E.tickIncrement(t,"M6","reverse")+1.5*v:i.exactMonths>.8?t=E.tickIncrement(t,"M1","reverse")+15.5*v:t-=v/2;var l=E.tickIncrement(t,r);if(l<=n)return l}return t}(x,t,y,c,i)),m=x,0;m<=u;)m=E.tickIncrement(m,y,!1,i);return{start:e.c2r(x,0,i),end:e.c2r(m,0,i),size:y,_dataSpan:u-c}},E.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=(Math.abs(r[1]-r[0])-(t._lBreaks||0))/a,E.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),H(t)},E.calcTicks=function(t,e){E.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=I(s.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var c="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var u=0;ui&&h=o:n<=o)&&!(c.length>r||n===e);n=E.tickIncrement(n,t.dtick,l,t.calendar)){e=n;var a=!1;u&&n!==(0|n)&&(a=!0),c.push({minor:a,value:n})}}(),t.rangebreaks){var h=c.length;if(h){var f=0;"auto"===t.tickmode&&(f=("y"===t._id.charAt(0)?2:6)*(t.tickfont?t.tickfont.size:12));for(var p,d=[],g=l?1:-1,m=l?h-1:0,v=l?0:h-1;g*v<=g*m;v+=g){var y=c[v];if(t.maskBreaks(y.value)!==w||(y.value=lt(y.value,t),!t._rl||t._rl[0]!==y.value&&t._rl[1]!==y.value)){var x=t.c2p(y.value);x===p?d[d.length-1].valuef)&&(p=x,d.push(y))}}c=d.reverse()}}st(t)&&360===Math.abs(r[1]-r[0])&&c.pop(),t._tmax=(c[c.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var b=new Array(c.length),_=0;_10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=v&&i<=10||e>=15*v)t._tickround="d";else if(e>=x&&i<=16||e>=y)t._tickround="M";else if(e>=b&&i<=19||e>=x)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(c)>3&&(W(t.exponentformat)&&!Z(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}E.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*q(e,r,R)):i>m?(e/=m,t.dtick="M"+q(e,1,F)):i>v?(t.dtick=q(e,v,t._hasDayOfWeekBreaks?[1,2,7,14]:N),t.tick0=s.dateTick0(t.calendar,!0)):i>y?t.dtick=q(e,y,F):i>x?t.dtick=q(e,x,B):i>b?t.dtick=q(e,b,B):(r=n(10),t.dtick=q(e,r,R))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+q(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):st(t)?(t.tick0=0,r=1,t.dtick=q(e,r,U)):(t.tick0=0,r=n(10),t.dtick=q(e,r,R));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},E.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,i);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?V:j,h=t+.01*o,f=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},E.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1]"+l,t._prevDateHead=l));e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=X(Math.pow(10,l),t,i,n);else if(a(o)||"D"===u&&s.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;"power"===p||W(p)&&Z(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":_)+f+"",e.fontSize*=1.25):("e"===p||"E"===p)&&f>2?e.text="1"+p+(h>0?"+":_)+f:(e.text=X(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):st(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=X(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=X(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=X(e.x,t,a,n)}(t,o,0,c,g),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var m=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[m(o.x-.5),m(o.x+t.dtick-.5)]}return o},E.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return E.hoverLabelText(t,e)+" - "+E.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=E.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var Y=["f","p","n","\u03bc","m","","k","M","G","T"];function W(t){return"SI"===t||"B"===t}function Z(t){return t>14||t<-15}function X(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=E.getTickFormat(e),h=e.separatethousands;if(n){var f={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};H(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":W(l)&&(t+=Y[c/3+5]));return i?_+t:t}function J(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-u:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),p.reverse()),r.width>0){var m=r.right-(e._offset+e._length);m>0&&(n.xr=1,n.r=m);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?u-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-u:0,h),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==f._dfltTitle[d]&&(n[l]+=Q(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}Z&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,et(e),n),i.autoMargin(t,rt(e),a),i.autoMargin(t,nt(e),s)})),r.skipTitle||Z&&"bottom"===e.side||Y.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+Q(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,u,f,p=E.getPxPosition(t,e);"x"===i?(l=e._offset+e._length/2,u="top"===e.side?p-r:p+r):(u=e._offset+e._length/2,l="right"===e.side?p+r:p-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(f={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var g=h.getTranslate(d.node().parentNode);f.offsetLeft=g.x,f.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(f.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:f,transform:s,attributes:{x:l,y:u,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Y)}}function X(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=tt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},E.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},E.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},E.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},E.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),i="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(i&&(o+=t.ticklen),r&&"outside"===t.ticks){var c=s.deg2rad(r);o=t.ticklen*Math.cos(c)+1,l=t.ticklen*Math.sin(c)}t.showticklabels&&(i||t.showline)&&(o+=.2*t.tickfont.size);var u,h,f,p,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(p="bottom"===t.side?1:-1,u=l*p,h=e+o*p,f="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+u},d.yFn=function(t){return t.dy+h+t.fontSize*f},d.anchorFn=function(t,e){return a(e)&&0!==e&&180!==e?e*p<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(p="right"===t.side?1:-1,u=o,h=-l*p,f=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(u+t.fontSize*f)*p},d.yFn=function(t){return t.dy+h+t.fontSize*k},d.anchorFn=function(e,r){return a(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},E.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],K);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},E.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&E.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=y(o[l])){u=d;break}var h=a("pattern",u);if(h===d)for(l=0;l<2;l++)(c=y(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*x)||T)for(r=0;rz&&RP&&(P=R);p/=(P-L)/(2*I),L=c.l2r(L),P=c.l2r(P),c.range=c._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function F(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function N(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,a,i)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(t){L&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),L=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function H(t,e,r,n){for(var a,i,o,l,c=!1,u={},h={},f=0;f=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(V(a),2!==t||dt||Vt(),pt)i.indexOf("select")>-1&&A(r,a,X,J,e.id,Et),i.indexOf("event")>-1&&h.click(a,r,e.id);else if(1===t&&dt){var s=g?j:P,c="s"===g||"w"===L?0:1,u=s._name+".range["+c+"]",f=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,c),p="left",d="middle";if(s.fixedrange)return;g?(d="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===L&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(vt).call(l.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:d}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",a,u,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+yt)),a=Math.max(0,Math.min(tt,r+xt)),i=Math.abs(n-yt),o=Math.abs(a-xt);function s(){kt="",bt.r=bt.l,bt.t=bt.b,Mt.attr("d","M0,0Z")}if(bt.l=Math.min(yt,n),bt.r=Math.max(yt,n),bt.t=Math.min(xt,a),bt.b=Math.max(xt,a),et.isSubplotConstrained)i>C||o>C?(kt="xy",i/$>o/tt?(o=i*tt/$,xt>a?bt.t=xt-o:bt.b=xt+o):(i=o*$/tt,yt>n?bt.l=yt-i:bt.r=yt+i),Mt.attr("d",q(bt))):s();else if(rt.isSubplotConstrained)if(i>C||o>C){kt="xy";var l=Math.min(bt.l/$,(tt-bt.b)/tt),c=Math.max(bt.r/$,(tt-bt.t)/tt);bt.l=l*$,bt.r=c*$,bt.b=(1-l)*tt,bt.t=(1-c)*tt,Mt.attr("d",q(bt))}else s();else!at||og[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":735,"fast-isnumeric":237}],801:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":704}],802:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),m=t("../../components/shapes/draw_newshape/helpers").handleEllipse,v=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=x.filter,S=x.tester,E=t("./handle_outline").clearSelect,C=t("./helpers"),L=C.p2r,P=C.axValue,I=C.getTransform;function z(t,e,r,n,a,i,o){var s,l,c,u,h,f,d,m,v,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(f=j(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),f(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=v(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function V(t,e,r){var n,i,o,s;for(n=0;n=0)W._fullLayout._deactivateShape(W);else if(!j){var r=Z.clickmode;b.done(ft).then((function(){if(b.clear(ft),2===t){for(lt.remove(),w=0;w-1&&z(e,W,a.xaxes,a.yaxes,a.subplot,a,lt),"event"===r&&W.emit("plotly_selected",void 0);s.click(W,e)})).catch(y.error)}},a.doneFn=function(){ht.remove(),b.done(ft).then((function(){b.clear(ft),a.gd.emit("plotly_selected",E),_&&a.selectionDefs&&(_.subtract=st,a.selectionDefs.push(_),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,x)),a.doneFnCompleted&&a.doneFnCompleted(pt)})).catch(y.error),j&&B(a)}},clearSelect:E,clearSelectionsCache:B,selectOnClick:z}},{"../../components/color":602,"../../components/dragelement/helpers":620,"../../components/drawing":624,"../../components/fx":642,"../../components/fx/helpers":638,"../../components/shapes/draw_newshape/display_outlines":687,"../../components/shapes/draw_newshape/helpers":688,"../../components/shapes/draw_newshape/newshapes":689,"../../lib":735,"../../lib/clear_gl_canvases":720,"../../lib/polygon":747,"../../lib/throttle":760,"../../plot_api/subroutines":774,"../../registry":866,"./axis_ids":786,"./constants":789,"./handle_outline":793,"./helpers":794,polybooljs:478}],803:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,s=i.ms2DateTime,l=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,h=t("../../constants/numerical"),f=h.FP_SAFE,p=h.BADNUM,d=h.LOG_CLIP,g=h.ONEDAY,m=h.ONEHOUR,v=h.ONEMIN,y=h.ONESEC,x=t("./axis_ids"),b=t("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function T(t){return Math.pow(10,t)}function k(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function A(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*d*Math.abs(n-a))}return p}function M(e,r,n,o){var s=l(e,n||t.calendar);if(s===p){if(!a(e))return p;if(e=+e,(o||{}).msUTC)return e;var c=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-c/10);s=l(new Date(u))+c/10}return s}function S(e,r,n){return s(e,r,n||t.calendar)}function E(e){return t._categories[Math.round(e)]}function C(e){if(k(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function L(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=L(t);return void 0!==e?e:a(t)?+t:void 0}function I(t,e,r){return n.round(r+e*t,2)}function z(t,e,r){return(t-r)/e}var O=function(e){return a(e)?I(e,t._m,t._b):p},D=function(e){return z(e,t._m,t._b)};if(t.rangebreaks){var R="y"===h;O=function(e){if(!a(e))return p;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=R;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,s=0,l=0;lu)){s=o<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?I(e,t._m2,h):0},D=function(e){var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return z(e,t._m2,t._B[n])}}t.c2l="log"===t.type?A:c,t.l2c="log"===t.type?T:c,t.l2p=O,t.p2l=D,t.c2p="log"===t.type?function(t,e){return O(A(t,e))}:O,t.p2c="log"===t.type?function(t){return T(D(t))}:D,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=D,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return A(o(t),e)},t.r2d=t.r2c=function(t){return T(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=A,t.l2d=T,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return T(D(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=D,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=M,t.c2d=t.c2r=t.l2d=t.l2r=S,t.d2p=t.r2p=function(e,r,n){return t.l2p(M(e,0,n))},t.p2d=t.p2r=function(t,e,r){return S(D(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=C,t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(D(t))},t.r2p=t.d2p,t.p2r=D,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=L,t.l2r=t.c2r=c,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(D(t))},t.r2p=t.d2p,t.p2r=D,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(a=0;af&&(s[n]=f),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else i.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=x.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,c=t.r2l(t[i][0],o),u=t.r2l(t[i][1],o),f="y"===h;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(p=!p),p&&t._rangebreaks.reverse();var d=p?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;sa&&(a+=7,sa&&(a+=24,s=n&&s=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function m(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,c=a._length,u=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),m=d[1]-d[0],v=g[1]-g[0];p[0]=(d[0]*(1-r)+r*g[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/m),a.range[0]=a.l2r(d[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(f){var y=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=a._offset-M,C=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":624,"../../lib":735,"../../registry":866,"./axes":783,d3:165}],808:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",h=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(o(c,l)){var p=i(c),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){i(t,c,s.cache),s.check=function(){if(l){var e=i(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h0&&a<0&&(a+=360);var s=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[a,o],[a,i],[a-s,i],[a-2*s,i],[a-3*s,i],[n,i]]]}}e.exports=function(t){return new _(t)},w.plot=function(t,e,r){var n=this,a=e[this.id],i=[],o=!1;for(var s in v.layerNameToAdjective)if("frame"!==s&&a["show"+s]){o=!0;break}for(var l=0;l0&&i._module.calcGeoJSON(a,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),c.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},w.updateProjection=function(t,e){var r=this.graphDiv,o=e[this.id],s=e._size,l=o.domain,c=o.projection,u=o.lonaxis,f=o.lataxis,p=u._ax,d=f._ax,g=this.projection=function(t){for(var e=t.projection.type,r=n.geo[v.projNames[e]](),a=t._isClipped?v.lonaxisSpan[e]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(t){return t?r:[]},s=0;sa*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(a-s*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*s).translate([l,c])},r.precision(v.precision),a&&r.clipAngle(a-v.clipPad);return r}(o),m=[[s.l+s.w*l.x[0],s.t+s.h*(1-l.y[1])],[s.l+s.w*l.x[1],s.t+s.h*(1-l.y[0])]],y=o.center||{},x=c.rotation||{},b=u.range||[],_=f.range||[];if(o.fitbounds){p._length=m[1][0]-m[0][0],d._length=m[1][1]-m[0][1],p.range=h(r,p),d.range=h(r,d);var w=(p.range[0]+p.range[1])/2,k=(d.range[0]+d.range[1])/2;if(o._isScoped)y={lon:w,lat:k};else if(o._isClipped){y={lon:w,lat:k},x={lon:w,lat:k,roll:x.roll};var A=c.type,M=v.lonaxisSpan[A]/2||180,S=v.lataxisSpan[A]/2||180;b=[w-M,w+M],_=[k-S,k+S]}else y={lon:w,lat:k},x={lon:w,lat:x.lat,roll:x.roll}}g.center([y.lon-x.lon,y.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(c.parallels);var E=T(b,_);g.fitExtent(m,E);var C=this.bounds=g.getBounds(E),L=this.fitScale=g.scale(),P=g.translate();if(!isFinite(C[0][0])||!isFinite(C[0][1])||!isFinite(C[1][0])||!isFinite(C[1][1])||isNaN(P[0])||isNaN(P[0])){for(var I=["fitbounds","projection.rotation","center","lonaxis.range","lataxis.range"],z="Invalid geo settings, relayout'ing to default view.",O={},D=0;D-1&&g(n.event,i,[r.xaxis],[r.yaxis],r.id,h),c.indexOf("event")>-1&&l.click(i,n.event))}))}function v(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},w.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,a="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",a),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(s.setClipUrl,a,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(t.mockAxis,r)},w.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,a=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},i.extendFlat(this.viewInitial,e)},w.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",a).attr("transform",n)}},{"../../components/color":602,"../../components/dragelement":621,"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/geo_location_utils":729,"../../lib/topojson_utils":762,"../../registry":866,"../cartesian/autorange":782,"../cartesian/axes":783,"../cartesian/select":802,"../plots":846,"./constants":813,"./projections":818,"./zoom":819,d3:165,"topojson-client":538}],815:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex,i=t("./geo"),o="geo",s=a(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,a=e._subplots.geo,s=0;s0&&L<0&&(L+=360);var P,I,z,O=(C+L)/2;if(!p){var D=d?h.projRotate:[O,0,0];P=r("projection.rotation.lon",D[0]),r("projection.rotation.lat",D[1]),r("projection.rotation.roll",D[2]),r("showcoastlines",!d&&y)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!y&&void 0)&&r("oceancolor")}(p?(I=-96.6,z=38.7):(I=d?O:P,z=(E[0]+E[1])/2),r("center.lon",I),r("center.lat",z),g)&&r("projection.parallels",h.projParallels||[0,60]);r("projection.scale"),r("showland",!!y&&void 0)&&r("landcolor"),r("showlakes",!!y&&void 0)&&r("lakecolor"),r("showrivers",!!y&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&y)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",y),r("subunitcolor"),r("subunitwidth")),d||r("showframe",y)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):m?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){a(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":735,"../get_data":820,"../subplot_defaults":860,"./constants":813,"./layout_attributes":816}],818:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map((function(t){return r(t,n)}))};if(!c.hasOwnProperty(e.type))return null;var a=c[e.type];return t.geo.stream(e,n(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,a)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map((function(t){return e(t,r)}))}}},a=[],i=[],o={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},s={lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var t=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],t}},l={polygonStart:u,lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var t=[],e=[];return i.forEach((function(r){!function(t){if((e=t.length)<4)return!1;var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];for(;++rn^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(t[0],r))return t.push(e),!0}))||t.push([e])})),i=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function u(){}var h=1e-6,f=Math.PI,p=f/2,d=(Math.sqrt(f),f/180),g=180/f;function m(t){return t>1?p:t<-1?-p:Math.asin(t)}function v(t){return t>1?0:t<-1?f:Math.acos(t)}var y=t.geo.projection,x=t.geo.projectionMutator;function b(t,e){var r=(2+p)*Math.sin(e);e/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>h;n++){var i=Math.cos(e);e-=a=(e+Math.sin(e)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(f*(4+f))*t*(1+Math.cos(e)),2*Math.sqrt(f/(4+f))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-f,0],[0,p],[f,0]]],[[[-f,0],[0,-p],[f,0]]]];function a(t,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],l}function i(){r=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],i=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]}))}))}e.invert&&(a.invert=function(t,i){for(var o=r[+(i<0)],s=n[+(i<0)],l=0,u=o.length;l=0;--a){var p;o=180*(p=n[1][a])[0][0]/f,s=180*p[0][1]/f,c=180*p[1][1]/f,u=180*p[2][0]/f,h=180*p[2][1]/f;r.push(l([[u-e,h-e],[u-e,c+e],[o+e,c+e],[o+e,s-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),i)},a},o.lobes=function(t){return arguments.length?(n=t.map((function(t){return t.map((function(t){return[[t[0][0]*f/180,t[0][1]*f/180],[t[1][0]*f/180,t[1][1]*f/180],[t[2][0]*f/180,t[2][1]*f/180]]}))})),i(),o):n.map((function(t){return t.map((function(t){return[[180*t[0][0]/f,180*t[0][1]/f],[180*t[1][0]/f,180*t[1][1]/f],[180*t[2][0]/f,180*t[2][1]/f]]}))}))},o},b.invert=function(t,e){var r=.5*e*Math.sqrt((4+f)/f),n=m(r),a=Math.cos(n);return[t/(2/Math.sqrt(f*(4+f))*(1+a)),m((n+r*(a+2))/(2+p))]},(t.geo.eckert4=function(){return y(b)}).raw=b;var _=t.geo.azimuthalEqualArea.raw;function w(t,e){if(arguments.length<2&&(e=t),1===e)return _;if(e===1/0)return T;function r(r,n){var a=_(r/e,n);return a[0]*=t,a}return r.invert=function(r,n){var a=_.invert(r/t,n);return a[0]*=e,a},r}function T(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function k(t,e){return[3*t/(2*f)*Math.sqrt(f*f/3-e*e),e]}function A(t,e){return[t,1.25*Math.log(Math.tan(f/4+.4*e))]}function M(t){return function(e){var r,n=t*Math.sin(e),a=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>h&&--a>0);return e/2}}T.invert=function(t,e){var r=2*m(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=x(w),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=w,k.invert=function(t,e){return[2/3*f*t/Math.sqrt(f*f/3-e*e),e]},(t.geo.kavrayskiy7=function(){return y(k)}).raw=k,A.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*f]},(t.geo.miller=function(){return y(A)}).raw=A,M(f);var S=function(t,e,r){var n=M(r);function a(r,a){return[t*r*Math.cos(a=n(a)),e*Math.sin(a)]}return a.invert=function(n,a){var i=m(a/e);return[n/(t*Math.cos(i)),m((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/p,Math.SQRT2,f);function E(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return y(S)}).raw=S,E.invert=function(t,e){var r,n=e,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-e)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>h&&--a>0);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return y(E)}).raw=E;var C=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function L(t,e){var r,n=Math.min(18,36*Math.abs(e)/f),a=Math.floor(n),i=n-a,o=(r=C[a])[0],s=r[1],l=(r=C[++a])[0],c=r[1],u=(r=C[Math.min(19,++a)])[0],h=r[1];return[t*(l+i*(u-o)/2+i*i*(u-2*l+o)/2),(e>0?p:-p)*(c+i*(h-s)/2+i*i*(h-2*c+s)/2)]}function P(t,e){return[t*Math.cos(e),e]}function I(t,e){var r,n=Math.cos(e),a=(r=v(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*a,Math.sin(e)*a]}function z(t,e){var r=I(t,e);return[(r[0]+t/p)/2,(r[1]+e)/2]}C.forEach((function(t){t[1]*=1.0144})),L.invert=function(t,e){var r=e/p,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=C[i][1],s=C[i+1][1],l=C[Math.min(19,i+2)][1],c=l-o,u=l-2*s+o,h=2*(Math.abs(r)-s)/c,f=u/c,m=h*(1-f*h*(1-2*f*h));if(m>=0||1===i){n=(e>=0?5:-5)*(m+a);var v,y=50;do{m=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=C[i][1],s=C[i+1][1],l=C[Math.min(19,i+2)][1],n-=(v=(e>=0?p:-p)*(s+m*(l-o)/2+m*m*(l-2*s+o)/2)-e)*g}while(Math.abs(v)>1e-12&&--y>0);break}}while(--i>=0);var x=C[i][0],b=C[i+1][0],_=C[Math.min(19,i+2)][0];return[t/(b+m*(_-x)/2+m*m*(_-2*b+x)/2),n*d]},(t.geo.robinson=function(){return y(L)}).raw=L,P.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return y(P)}).raw=P,I.invert=function(t,e){if(!(t*t+4*e*e>f*f+h)){var r=t,n=e,a=25;do{var i,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),p=Math.sin(2*n),d=c*c,g=u*u,m=s*s,y=1-g*l*l,x=y?v(u*l)*Math.sqrt(i=1/y):i=0,b=2*x*u*s-t,_=x*c-e,w=i*(g*m+x*u*l*d),T=i*(.5*o*p-2*x*c*s),k=.25*i*(p*s-x*c*g*o),A=i*(d*l+x*m*u),M=T*k-A*w;if(!M)break;var S=(_*T-b*A)/M,E=(b*k-_*w)/M;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--a>0);return[r,n]}},(t.geo.aitoff=function(){return y(I)}).raw=I,z.invert=function(t,e){var r=t,n=e,a=25;do{var i,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),c=s*s,u=o*o,f=Math.sin(r),d=Math.cos(r/2),g=Math.sin(r/2),m=g*g,y=1-u*d*d,x=y?v(o*d)*Math.sqrt(i=1/y):i=0,b=.5*(2*x*o*g+r/p)-t,_=.5*(x*s+n)-e,w=.5*i*(u*m+x*o*d*c)+.5/p,T=i*(f*l/4-x*s*g),k=.125*i*(l*g-x*s*u*f),A=.5*i*(c*d+x*m*o)+.5,M=T*k-A*w,S=(_*T-b*A)/M,E=(b*k-_*w)/M;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--a>0);return[r,n]},(t.geo.winkel3=function(){return y(z)}).raw=z}},{}],819:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function h(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],h={},f={};function p(t,e){h[n+"."+t]=a.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=a.nestedProperty(u,t);r.get()!==e&&(r.set(e),a.nestedProperty(l,t).set(e),f[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function f(t,e){var r=u(0,e);function a(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),h(t,e,a)})),r}function p(t,e){var r,a,i,o,s,f,p,d,g,m=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),a=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return m.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=e.rotate(),i=e.translate(),o=a,s=v(r)})).on("zoom",(function(){if(f=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return m.scale(e.scale()),void m.translate(e.translate());e.scale(n.event.scale),e.translate([i[0],n.event.translate[1]]),s?v(f)&&(d=v(f),p=[o[0]+(d[0]-s[0]),a[1],a[2]],e.rotate(p),o=p):s=v(r=f),g=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&h(t,e,y)})),m}function d(t,e){var r,a={r:e.rotate(),k:e.scale()},i=u(0,e),o=function(t){var e=0,r=arguments.length,a=[];for(;++ed?(i=(h>0?90:-90)-p,a=0):(i=Math.asin(h/d)*s-p,a=Math.sqrt(d*d-h*h));var g=180-i-2*p,m=(Math.atan2(f,u)-Math.atan2(c,a))*s,v=(Math.atan2(f,u)-Math.atan2(c,-a))*s;return b(r[0],r[1],i,m)<=b(r[0],r[1],g,v)?[i,m,r[2]]:[g,v,r[2]]}function b(t,e,r,n){var a=_(r-t),i=_(n-e);return Math.sqrt(a*a+i*i)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,a=t.slice(),i=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return a[i]=t[i]*l-t[s]*c,a[s]=t[s]*l+t[i]*c,a}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,a=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(i=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],i||s?(i&&(m(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(m(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=a),Math.abs(c.dragStart[0]-n).999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":602,"../../../lib":735,"../../../registry":866,"../../get_data":820,"../../subplot_defaults":860,"./axis_defaults":828,"./layout_attributes":831}],831:[function(t,e,r){"use strict";var n=t("./axis_attributes"),a=t("../../domain").attributes,i=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":735,"../../../lib/extend":726,"../../domain":810,"./axis_attributes":827}],832:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}},{"../../../lib/str2rgbarray":758}],833:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var f=u.nticks||a.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/f)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=h}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],a=new Array(n.length),i=0;ir.deltaY?1.1:1/1.1,i=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*i.x,y:n*i.y,z:n*i.z})}a(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,a=e.container.getBoundingClientRect(),i=a.width,o=a.height;n.setAttributeNS(null,"viewBox","0 0 "+i+" "+o),n.setAttributeNS(null,"width",i),n.setAttributeNS(null,"height",o),x(e),e.glplot.axes.update(e.axesOptions);for(var s,l=Object.keys(e.traces),c=null,u=e.glplot.selection,d=0;d")):"isosurface"===t.type||"volume"===t.type?(w.valueLabel=f.tickText(e._mockAxis,e._mockAxis.d2l(u.traceCoordinate[3]),"hover").text,M.push("value: "+w.valueLabel),u.textLabel&&M.push(u.textLabel),y=M.join("
")):y=u.textLabel;var S={x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:_};p.appendArrayPointValue(S,b,_),t._module.eventData&&(S=b._module.eventData(S,u,b,{},_));var E={points:[S]};e.fullSceneLayout.hovermode&&p.loneHover({trace:b,x:(.5+.5*v[0]/v[3])*i,y:(.5-.5*v[1]/v[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:y,name:c.name,color:p.castHoverOption(b,_,"bgcolor")||c.color,borderColor:p.castHoverOption(b,_,"bordercolor"),fontFamily:p.castHoverOption(b,_,"font.family"),fontSize:p.castHoverOption(b,_,"font.size"),fontColor:p.castHoverOption(b,_,"font.color"),nameLength:p.castHoverOption(b,_,"namelength"),textAlign:p.castHoverOption(b,_,"align"),hovertemplate:h.castOption(b,_,"hovertemplate"),hovertemplateLabels:h.extendFlat({},S,w),eventData:[S]},{container:n,gd:r}),u.buttons&&u.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),s=E}else p.loneUnhover(n),r.emit("plotly_unhover",s);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function k(t,e,r){for(var n=t.fullSceneLayout,a=0;a<3;a++){var i=T[a],o=i.charAt(0),s=n[i],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(h.isArrayOrTypedArray(l))for(var f,p=0;p<(u||l.length);p++)if(h.isArrayOrTypedArray(l[p]))for(var d=0;dm[1][i])m[0][i]=-1,m[1][i]=1;else{var C=m[1][i]-m[0][i];m[0][i]-=C/32,m[1][i]+=C/32}if("reversed"===s.autorange){var L=m[0][i];m[0][i]=m[1][i],m[1][i]=L}}else{var P=s.range;m[0][i]=s.r2l(P[0]),m[1][i]=s.r2l(P[1])}m[0][i]===m[1][i]&&(m[0][i]-=1,m[1][i]+=1),v[i]=m[1][i]-m[0][i],this.glplot.setBounds(i,{min:m[0][i]*f[i],max:m[1][i]*f[i]})}var I=c.aspectmode;if("cube"===I)g=[1,1,1];else if("manual"===I){var z=c.aspectratio;g=[z.x,z.y,z.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var O=[1,1,1];for(i=0;i<3;++i){var D=y[l=(s=c[T[i]]).type];O[i]=Math.pow(D.acc,1/D.count)/f[i]}g="data"===I||Math.max.apply(null,O)/Math.min.apply(null,O)<=4?O:[1,1,1]}c.aspectratio.x=u.aspectratio.x=g[0],c.aspectratio.y=u.aspectratio.y=g[1],c.aspectratio.z=u.aspectratio.z=g[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=h.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var a=["up","center","eye"],i=["x","y","z"];return e[a[r]]&&t[a[r]][i[n]]===e[a[r]][i[n]]}var a=!1;if(void 0===r)a=!0;else{for(var i=0;i<3;i++)for(var o=0;o<3;o++)if(!n(e,r,i,o)){a=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(a=!0)}return a},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=h.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),f=l||c;if(f){var p={};if(l&&(e=this.getCamera(),n=(r=h.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(a=this.glplot.getAspectratio(),o=(i=h.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),h.nestedProperty(s,this.id+".camera").set(e);if(c)i.set(a),h.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw()}return f},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",f={x:0,y:0,z:1},p={};p[c]=f;var d=n.layout;u.call("_storeDirectGUIEdit",d,a._preGUI,p),i.up=f,h.nestedProperty(d,c).set(f)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i),function(t,e,r){for(var n=0,a=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[i+l]=Math.min(s*t[i+l],255)}}(i,r,a);var o=document.createElement("canvas");o.width=r,o.height=a;var s,l=o.getContext("2d"),c=l.createImageData(r,a);switch(c.data.set(i),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];f.setConvert(e,this.fullLayout),e.setScale=h.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":642,"../../lib":735,"../../lib/show_no_webgl_msg":756,"../../lib/str2rgbarray":758,"../../plots/cartesian/axes":783,"../../registry":866,"./layout/convert":829,"./layout/spikes":832,"./layout/tick_marks":833,"./project":834,"gl-plot3d":300,"has-passive-events":414,"is-mobile":424,"webgl-context":565}],836:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var a=new Array(n),i=0;i\xa9 OpenStreetMap
',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'\xa9 CARTO',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under CC BY SA.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},a=Object.keys(n);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:a,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",a.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],839:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(a){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(i){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":735}],840:[function(t,e,r){"use strict";var n=t("mapbox-gl"),a=t("../../lib"),i=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./mapbox"),h=r.constants=t("./constants");function f(t){return"string"==typeof t&&(-1!==h.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(h.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;lx/2){var b=g.split("|").join("
");v.text(b).attr("data-unformatted",b).call(c.convertToTspans,t),y=l.bBox(v.node())}v.attr("transform","translate(-3, "+(8-y.height)+")"),m.insert("rect",".static-attribution").attr({x:-y.width-6,y:-y.height-3,width:y.width+6,height:y.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;y.width+6>x&&(_=x/(y.width+6));var w=[n.l+n.w*u.x[1],n.t+n.h*(1-u.y[0])];m.attr("transform","translate("+w[0]+","+w[1]+") scale("+_+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates})},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.updateLayer=function(t){var e,r=this.subplot,n=u(t),a=this.subplot.belowLookup["layout-"+this.index];if("traces"===a)for(var i=r.getMapLayers(),s=0;s1)for(r=0;r-1&&v(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},_.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=h(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},_.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},_.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){y.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&u.text()?" - ":"")}},y.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=y.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i1&&z.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&z.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),y.linkSubplots(h,s,u,a),y.cleanPlot(h,s,u,a);var B=!(!a._has||!a._has("gl2d")),N=!(!s._has||!s._has("gl2d")),j=!(!a._has||!a._has("cartesian"))||B,V=!(!s._has||!s._has("cartesian"))||N;j&&!V?a._bgLayer.remove():V&&!j&&(s._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&f({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=y.layoutAttributes.width.min,p=y.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||d)&&(d&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),y.sanitizeMargins(r)},y.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,c=i.componentsRegistry,u=e._basePlotModules,h=i.subplotsRegistry.cartesian;for(a in c)(s=c[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var f in u.length||u.push(h),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(l.subplotSort);for(o=0;o.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,h=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;a[e]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:f,size:r.b+o},t:{val:h,size:r.t+o}},i[e]=1}else delete a[e],delete i[e];if(!n._replotting)return y.doAutoMargin(t)}},y.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),E(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,c=n.r,u=n.t,h=n.b,f=e.width,p=e.height,d=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in d)g[m]||delete d[m];for(var v in d.base={l:{val:0,size:s},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:h}},d){var x=d[v].l||{},b=d[v].b||{},_=x.val,w=x.size,T=b.val,k=b.size;for(var A in d){if(a(w)&&d[A].r){var M=d[A].r.val,S=d[A].r.size;if(M>_){var C=(w*M+(S-f)*_)/(M-_),L=(S*(1-_)+(w-f)*(1-M))/(M-_);C>=0&&L>=0&&f-(C+L)>0&&C+L>s+c&&(s=C,c=L)}}if(a(k)&&d[A].t){var P=d[A].t.val,I=d[A].t.size;if(P>T){var z=(k*P+(I-p)*T)/(P-T),O=(I*(1-T)+(k-p)*(1-P))/(P-T);z>=0&&O>=0&&p-(O+z)>0&&z+O>h+u&&(h=z,u=O)}}}}}if(r.l=Math.round(s),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(h),r.p=Math.round(n.pad),r.w=Math.round(f)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!e._replotting&&y.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var D=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return i.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,s=0;function l(){return o++,function(){s++,n||s!==o||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return i.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],o=l.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}y.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},y.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&y.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(l.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var h={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};return e||(h.layout=u(s)),t.framework&&t.framework.isPolar&&(h=t.framework.getConfig()),c&&(h.frames=u(c)),i&&(h.config=u(t._context,!0)),"object"===n?h:JSON.stringify(h)},y.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,d[e]=i}}for(I(c,f,p),a=0;a1e-10?t:0}function f(t,e,r){e=e||0,r=r||0;for(var n=t.length,a=new Array(n),i=0;i0?r:1/0})),a=n.mod(r+1,e.length);return[e[r],e[a]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var a=-e*r,i=e*e+1,o=2*(e*a-r),s=a*a+r*r-t*t,l=Math.sqrt(o*o-4*i*s),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[[c,e*c+a+n],[u,e*u+a+n]]},clampTiny:h,pathPolygon:function(t,e,r,n,a,i){return"M"+f(u(t,e,r,n),a,i).join("L")},pathPolygonAnnulus:function(t,e,r,n,a,i,o){var s,l;t=0?f.angularAxis.domain:n.extent(T),E=Math.abs(T[1]-T[0]);A&&!k&&(E=0);var C=S.slice();M&&k&&(C[1]+=E);var L=f.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),f.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var P=f.angularAxis.ticksStep||(C[1]-C[0])/(L*(f.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var I=n.range.apply(this,C);if(I=I.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=M?E:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),O=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));t=n.select(O)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var D,R=t.select(".chart-group"),F={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+f.font.outlineColor})).join(",")};if(f.showLegend){D=t.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var N=p.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:p.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:D,elements:N,reverseOrder:f.legend.reverseOrder})})();var j=D.node().getBBox();x=Math.min(f.width-j.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),D.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else D=t.select(".legend-group").style({display:"none"});t.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(f.width-(f.margin.left+f.margin.right+2*x+(j?j.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),f.title&&f.title.text){var U=t.select("g.title-group text").style(B).text(f.title.text),q=U.node().getBBox();U.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(F);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});function W(t,e){return s(t)%360+f.orientation}if(f.radialAxis.visible){var Z=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),H.selectAll(".domain").style(F),H.selectAll("g>text").text((function(t,e){return this.textContent+f.radialAxis.ticksSuffix})).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),J=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),X.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(f.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(f.minorTicks+1)==0)})).style(F),J.selectAll(".minor").style({stroke:f.minorTickColor}),X.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var K=X.select("text.axis-text").attr({x:x+f.labelOffset,dy:i+"em",transform:function(t,e){var r=W(t),n=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix})).style(B);f.angularAxis.rewriteTicks&&K.text((function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)}));var Q=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));D.attr({transform:"translate("+[x+Q,f.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||$){var et=[];p.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var ht=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(Y).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(x+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ft=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(Y).radius;ft.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Y).radius);var a=o.util.convertToCartesian(n,f.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){ft.style({opacity:0}),ut.hide(),lt.hide(),ct.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,h=this.getBoundingClientRect(),f=t.node().getBoundingClientRect(),p=[h.left+h.width/2-V[0]-f.left,h.top+h.height/2-V[1]-f.top];ut.config({color:s}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()})).on("mouseout.tooltip",(function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return u},f.getinputConfig=function(){return c},f.radialScale=function(t){return r},f.angularScale=function(t){return s},f.svg=function(){return t},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.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}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,a,i)},"stroke-width":function(t,e){return d["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,a,i)},opacity:function(t,e){return d.opacity(r,a,i)},display:function(t,e){return d.display(r,a,i)}})}};var h=e.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(t){return-f/2})).endAngle((function(t){return f/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var m=g.selectAll("path.mark").data((function(t,e){return t}));m.enter().append("path").attr({class:"mark"}),m.style(d).each(c[e.geometryType]),m.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,h=u?e.height:c*o.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),p=f.enter().append("svg").attr({width:300,height:h+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var d=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(d).range(l),m=n.scale[u?"linear":"ordinal"]().domain(d)[u?"range":"rangePoints"]([0,h]);if(u){var v=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=f.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(m).orient("right"),b=f.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",h=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(h);var f=i.padding,p=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},g=p.width+2*f+l,m=p.height+2*f;return r.attr({d:"M"+[[l,-m/2],[l,-m/4],[i.hasTick?0:l,0],[l,m/4],[l,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-m/2+2*f]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(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 i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[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"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach((function(t,e){u[c[l.indexOf(t.key)]]=t.value})),s.margin=u}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}};return t}},{"../../../constants/alignment":704,"../../../lib":735,d3:165}],856:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,h=new s;function f(r,s){return s&&(u=s),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return f.isPolar=!0,f.svg=function(){return a.svg()},f.getConfig=function(){return e},f.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},f.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},f.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,h.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},f.undo=function(){h.undo()},f.redo=function(){h.redo()},f},c.fillLayout=function(t){var e=n.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:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":602,"../../../lib":735,"./micropolar":855,"./undo_manager":857,d3:165}],857:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=90||s>90&&l>=450?1:u<=0&&f<=0?0:Math.max(u,f);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&h>=0?0:Math.min(c,h);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&f>=0?0:Math.min(u,f);n=l>=360?1:c<=0&&h<=0?0:Math.max(c,h);return[e,r,n,a]}(f),x=y[2]-y[0],b=y[3]-y[1],_=h/u,w=Math.abs(b/x);_>w?(p=u,v=(h-(d=u*w))/n.h/2,g=[o[0],o[1]],m=[c[0]+v,c[1]-v]):(d=h,v=(u-(p=h/w))/n.w/2,g=[o[0]+v,o[1]-v],m=[c[0],c[1]]),this.xLength2=p,this.yLength2=d,this.xDomain2=g,this.yDomain2=m;var T=this.xOffset2=n.l+n.w*g[0],k=this.yOffset2=n.t+n.h*(1-m[1]),A=this.radius=p/x,M=this.innerRadius=e.hole*A,S=this.cx=T-A*y[0],L=this.cy=k+A*y[3],P=this.cxx=S-T,I=this.cyy=L-k;this.radialAxis=this.mockAxis(t,e,a,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[a.side],domain:[M/n.w,A/n.w]}),this.angularAxis=this.mockAxis(t,e,i,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:m});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",R(P,I)),r.frontplot.attr("transform",R(T,k)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",R(S,L)).call(s.fill,e.bgcolor)},I.mockAxis=function(t,e,r,n){var a=o.extendFlat({},r,n);return f(a,e,t),a},I.mockCartesianAxis=function(t,e,r){var n=this,a=r._id,i=o.extendFlat({type:"linear"},r);h(i,t);var s={x:[0,2],y:[1,3]};return i.setRange=function(){var t=n.sectorBBox,r=s[a],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);i.range=[t[r[0]]*l,t[r[1]]*l]},i.isPtWithinRange="x"===a?function(t){return n.isPtInside(t)}:function(){return!0},i.setRange(),i.setScale(),i},I.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,a=e.radialaxis;n.setScale(),p(r,n);var i=n.range;a.range=i.slice(),a._input.range=i.slice(),n._rl=[n.r2l(i[0],null,"gregorian"),n.r2l(i[1],null,"gregorian")]},I.updateRadialAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,h=r.cy,f=e.radialaxis,p=E(e.sector[0],360),d=r.radialAxis,g=l90&&p<=270&&(d.tickangle=180);var m=function(t){return"translate("+(d.l2p(t.x)+l)+",0)"},v=z(f);if(r.radialTickLayout!==v&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=v),g){d.setScale();var y=u.calcTicks(d),x=u.clipEnds(d,y),b=u.getTickSigns(d)[2];u.drawTicks(n,d,{vals:y,layer:a["radial-axis"],path:u.makeTickPath(d,0,b),transFn:m,crisp:!1}),u.drawGrid(n,d,{vals:x,layer:a["radial-grid"],path:function(t){return r.pathArc(d.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),u.drawLabels(n,d,{vals:y,layer:a["radial-axis"],transFn:m,labelFns:u.makeLabelFns(d,0)})}var _=r.radialAxisAngle=r.vangles?L(O(C(f.angle),r.vangles)):f.angle,w=R(c,h),T=w+F(-_);D(a["radial-axis"],g&&(f.showticklabels||f.ticks),{transform:T}),D(a["radial-grid"],g&&f.showgrid,{transform:w}),D(a["radial-line"].select("line"),g&&f.showline,{x1:l,y1:0,x2:i,y2:0,transform:T}).attr("stroke-width",f.linewidth).call(s.stroke,f.linecolor)},I.updateRadialAxisTitle=function(t,e,r){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=e.radialaxis,c=this.id+"title",u=void 0!==r?r:this.radialAxisAngle,h=C(u),f=Math.cos(h),p=Math.sin(h),d=0;if(s.title){var g=l.bBox(this.layers["radial-axis"].node()).height,m=s.title.font.size;d="counterclockwise"===s.side?-g-.4*m:g+.8*m}this.layers["radial-axis-title"]=v.draw(n,c,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:S(n,"Click to enter radial axis title"),attributes:{x:i+a/2*f+d*p,y:o-a/2*p+d*f,"text-anchor":"middle"},transform:{rotate:-u}})},I.updateAngularAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,l=r.innerRadius,c=r.cx,h=r.cy,f=e.angularaxis,p=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",f.rotation),p.setGeometry(),p.setScale();var d=function(t){return p.t2g(t.x)};"linear"===p.type&&"radians"===p.thetaunit&&(p.tick0=L(p.tick0),p.dtick=L(p.dtick));var g=function(t){return R(c+i*Math.cos(t),h-i*Math.sin(t))},m=u.makeLabelFns(p,0).labelStandoff,v={xFn:function(t){var e=d(t);return Math.cos(e)*m},yFn:function(t){var e=d(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(m+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*k)},anchorFn:function(t){var e=d(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=d(t);return-.5*(1+Math.sin(n))*r}},y=z(f);r.angularTickLayout!==y&&(a["angular-axis"].selectAll("."+p._id+"tick").remove(),r.angularTickLayout=y);var x,b=u.calcTicks(p);if("linear"===e.gridshape?(x=b.map(d),o.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,"category"===p.type&&(b=b.filter((function(t){return o.isAngleInsideSector(d(t),r.sectorInRad)}))),p.visible){var _="inside"===p.ticks?-1:1,w=(p.linewidth||1)/2;u.drawTicks(n,p,{vals:b,layer:a["angular-axis"],path:"M"+_*w+",0h"+_*p.ticklen,transFn:function(t){var e=d(t);return g(e)+F(-L(e))},crisp:!1}),u.drawGrid(n,p,{vals:b,layer:a["angular-grid"],path:function(t){var e=d(t),r=Math.cos(e),n=Math.sin(e);return"M"+[c+l*r,h-l*n]+"L"+[c+i*r,h-i*n]},transFn:o.noop,crisp:!1}),u.drawLabels(n,p,{vals:b,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return g(d(t))},labelFns:v})}D(a["angular-line"].select("path"),f.showline,{d:r.pathSubplot(),transform:R(c,h)}).attr("stroke-width",f.linewidth).call(s.stroke,f.linecolor)},I.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},I.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=A.MINZOOM,c=A.OFFEDGE,u=e.radius,h=e.innerRadius,f=e.cx,p=e.cy,v=e.cxx,_=e.cyy,w=e.sectorInRad,T=e.vangles,k=e.radialAxis,S=M.clampTiny,E=M.findXYatLength,C=M.findEnclosingVertexAngles,L=A.cornerHalfWidth,P=A.cornerLen/2,I=d.makeDragger(o,"path","maindrag","crosshair");n.select(I).attr("d",e.pathSubplot()).attr("transform",R(f,p));var z,O,D,F,B,N,j,V,U,q={element:I,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function H(t,e){return Math.sqrt(t*t+e*e)}function G(t,e){return H(t-v,e-_)}function Y(t,e){return Math.atan2(_-e,t-v)}function W(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Z(t,r){if(0===t)return e.pathSector(2*L);var n=P/t,a=r-n,i=r+n,o=Math.max(0,Math.min(t,u)),s=o-L,l=o+L;return"M"+W(s,a)+"A"+[s,s]+" 0,0,0 "+W(s,i)+"L"+W(l,i)+"A"+[l,l]+" 0,0,1 "+W(l,a)+"Z"}function X(t,r,n){if(0===t)return e.pathSector(2*L);var a,i,o=W(t,r),s=W(t,n),l=S((o[0]+s[0])/2),c=S((o[1]+s[1])/2);if(l&&c){var u=c/l,h=-1/u,f=E(L,u,l,c);a=E(P,h,f[0][0],f[0][1]),i=E(P,h,f[1][0],f[1][1])}else{var p,d;c?(p=P,d=L):(p=L,d=P),a=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+a.join("L")+"L"+i.reverse().join("L")+"Z"}function J(t,e){return e=Math.max(Math.min(e,u),h),tl?(t-1&&1===t&&x(n,r,[e.xaxis],[e.yaxis],e.id,q),a.indexOf("event")>-1&&m.click(r,n,e.id)}q.prepFn=function(t,n,i){var o=r._fullLayout.dragmode,l=I.getBoundingClientRect();if(z=n-l.left,O=i-l.top,T){var c=M.findPolygonOffset(u,w[0],w[1],T);z+=v+c[0],O+=_+c[1]}switch(o){case"zoom":q.moveFn=T?tt:Q,q.clickFn=nt,q.doneFn=et,function(){D=null,F=null,B=e.pathSubplot(),N=!1;var t=r._fullLayout[e.id];j=a(t.bgcolor).getLuminance(),(V=d.makeZoombox(s,j,f,p,B)).attr("fill-rule","evenodd"),U=d.makeCorners(s,f,p),b(r)}();break;case"select":case"lasso":y(t,n,i,q,o)}},I.onmousemove=function(t){m.hover(r,t,e.id),r._fullLayout._lasthover=I,r._fullLayout._hoversubplot=e.id},I.onmouseout=function(t){r._dragging||g.unhover(r,t)},g.init(q)},I.updateRadialDrag=function(t,e,r){var a=this,s=a.gd,l=a.layers,c=a.radius,u=a.innerRadius,h=a.cx,f=a.cy,p=a.radialAxis,m=A.radialDragBoxSize,v=m/2;if(p.visible){var y,x,_,k=C(a.radialAxisAngle),M=p._rl,S=M[0],E=M[1],P=M[r],I=.75*(M[1]-M[0])/(1-e.hole)/c;r?(y=h+(c+v)*Math.cos(k),x=f-(c+v)*Math.sin(k),_="radialdrag"):(y=h+(u-v)*Math.cos(k),x=f-(u-v)*Math.sin(k),_="radialdrag-inner");var z,B,N,j=d.makeRectDragger(l,_,"crosshair",-v,-v,m,m),V={element:j,gd:s};D(n.select(j),p.visible&&u0==(r?N>S:Nn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*i},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var a=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(a(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,a){var i,o,s=e[a],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(i=new Array(l),o=0;o0){for(var n=[],a=0;a=u&&(p.min=0,g.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var f=o("color"),p=f!==a.color.dflt?f:r.font.color,d=e._name.charAt(0).toUpperCase(),g="Component "+d,m=o("title.text",g);e._hovertitle=m===g?m:d,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":602,"../../lib":735,"../../plot_api/plot_template":773,"../cartesian/line_grid_defaults":799,"../cartesian/tick_label_defaults":804,"../cartesian/tick_mark_defaults":805,"../cartesian/tick_value_defaults":806,"../subplot_defaults":860,"./layout_attributes":863}],865:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,f=t("../plots"),p=t("../cartesian/axes"),d=t("../../components/dragelement"),g=t("../../components/fx"),m=t("../../components/dragelement/helpers"),v=m.freeMode,y=m.rectMode,x=t("../../components/titles"),b=t("../cartesian/select").prepSelect,_=t("../cartesian/select").selectOnClick,w=t("../cartesian/select").clearSelect,T=t("../cartesian/select").clearSelectionsCache,k=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var M=A.prototype;M.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},M.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*x?a=(i=x)*S:i=(a=y)/S,o=m*a/y,s=v*i/x,r=e.l+e.w*d-a/2,n=e.t+e.h*(1-g)-i/2,f.x0=r,f.y0=n,f.w=a,f.h=i,f.sum=b,f.xaxis={type:"linear",range:[_+2*T-b,b-_-2*w],domain:[d-o/2,d+o/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(t){return t.a>=f.aaxis.range[0]&&t.a<=f.aaxis.range[1]&&t.b>=f.baxis.range[1]&&t.b<=f.baxis.range[0]&&t.c>=f.caxis.range[1]&&t.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[_,b-w-T],domain:[g-s/2,g+s/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var k=f.yaxis.domain[0],A=f.aaxis=h({},t.aaxis,{range:[_,b-w-T],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});u(A,f.graphDiv._fullLayout),A.setScale();var M=f.baxis=h({},t.baxis,{range:[b-_-T,w],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});u(M,f.graphDiv._fullLayout),M.setScale();var E=f.caxis=h({},t.caxis,{range:[b-_-w,T],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});u(E,f.graphDiv._fullLayout),E.setScale();var C="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";f.clipDef.select("path").attr("d",C),f.layers.plotbg.select("path").attr("d",C);var L="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";f.clipDefRelative.select("path").attr("d",L);var P="translate("+r+","+n+")";f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),f.clipDefRelative.select("path").attr("transform",null);var I="translate("+(r-M._offset)+","+(n+i)+")";f.layers.baxis.attr("transform",I),f.layers.bgrid.attr("transform",I);var z="translate("+(r+a/2)+","+n+")rotate(30)translate(0,"+-A._offset+")";f.layers.aaxis.attr("transform",z),f.layers.agrid.attr("transform",z);var O="translate("+(r+a/2)+","+n+")rotate(-30)translate(0,"+-E._offset+")";f.layers.caxis.attr("transform",O),f.layers.cgrid.attr("transform",O),f.drawAxes(!0),f.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",M.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",E.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},M.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=x.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=x.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},M.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,s=this.layers[n],l=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+i+"tick").remove(),this[l]=c),t.setScale();var u=p.calcTicks(t),h=p.clipEnds(t,u),f=p.makeTransFn(t),d=p.getTickSigns(t)[2],g=o.deg2rad(30),m=d*(t.linewidth||1)/2,v=d*t.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+m+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+m+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];p.drawTicks(r,t,{vals:"inside"===t.ticks?h:u,layer:s,path:b,transFn:f,crisp:!1}),p.drawGrid(r,t,{vals:h,layer:this.layers[a+"grid"],path:_,transFn:f,crisp:!1}),p.drawLabels(r,t,{vals:u,layer:s,transFn:f,labelFns:p.makeLabelFns(t,0,30)})};var E=k.MINZOOM/2+.87,C="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",L="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",P="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",I=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}M.clearSelect=function(){T(this.dragOptions),w(this.dragOptions.gd)},M.initInteractions=function(){var t,e,r,n,u,h,f,p,m,x,w=this,T=w.layers.plotbg.select("path").node(),A=w.graphDiv,M=A._fullLayout._zoomlayer;function E(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function O(t,e){var r=A._fullLayout.clickmode;z(A),2===t&&(A.emit("plotly_doubleclick",null),i.call("_guiRelayout",A,E({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&_(e,A,[w.xaxis],[w.yaxis],w.id,w.dragOptions),r.indexOf("event")>-1&&g.click(A,e,w.id)}function D(t,e){return 1-e/w.h}function R(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function F(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function B(a,i){var o=t+a,s=e+i,l=Math.max(0,Math.min(1,D(0,e),D(0,s))),c=Math.max(0,Math.min(1,R(t,e),R(o,s))),d=Math.max(0,Math.min(1,F(t,e),F(o,s))),g=(l/2+d)*w.w,v=(1-l/2-c)*w.w,y=(g+v)/2,b=v-g,_=(1-l)*w.h,T=_-b/S;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),x.transition().style("opacity",1).duration(200),p=!0),A.emit("plotly_relayouting",E(u))}function N(){z(A),u!==r&&(i.call("_guiRelayout",A,E(u)),I&&A.data&&A._context.showTips&&(o.notifier(s(A,"Double-click to zoom back out"),"long"),I=!1))}function j(t,e){var n=t/w.xaxis._m,a=e/w.yaxis._m,i=[(u={a:r.a-a,b:r.b+(n+a)/2,c:r.c-(n-a)/2}).a,u.b,u.c].sort(),o=i.indexOf(u.a),s=i.indexOf(u.b),l=i.indexOf(u.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),u={a:i[o],b:i[s],c:i[l]},e=(r.a-u.a)*w.yaxis._m,t=(r.c-u.c-r.b+u.b)*w.xaxis._m);var h="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var f="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",f),w.aaxis.range=[u.a,w.sum-u.b-u.c],w.baxis.range=[w.sum-u.a-u.c,u.b],w.caxis.range=[w.sum-u.a-u.b,u.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,w),A.emit("plotly_relayouting",E(u))}function V(){i.call("_guiRelayout",A,E(u))}this.dragOptions={element:T,gd:A,plotinfo:{id:w.id,domain:A._fullLayout[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(i,o,s){w.dragOptions.xaxes=[w.xaxis],w.dragOptions.yaxes=[w.yaxis];var c=w.dragOptions.dragmode=A._fullLayout.dragmode;v(c)?w.dragOptions.minDrag=1:w.dragOptions.minDrag=void 0,"zoom"===c?(w.dragOptions.moveFn=B,w.dragOptions.clickFn=O,w.dragOptions.doneFn=N,function(i,o,s){var c=T.getBoundingClientRect();t=o-c.left,e=s-c.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,n=w.aaxis.range[1]-r.a,h=a(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),f="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,m=M.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",f),x=M.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),w.clearSelect(A)}(0,o,s)):"pan"===c?(w.dragOptions.moveFn=j,w.dragOptions.clickFn=O,w.dragOptions.doneFn=V,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},u=r,w.clearSelect(A)):(y(c)||v(c))&&b(i,o,s,w.dragOptions,c)}},T.onmousemove=function(t){g.hover(A,t,w.id),A._fullLayout._lasthover=T,A._fullLayout._hoversubplot=w.id},T.onmouseout=function(t){A._dragging||d.unhover(A,t)},d.init(this.dragOptions)}},{"../../components/color":602,"../../components/dragelement":621,"../../components/dragelement/helpers":620,"../../components/drawing":624,"../../components/fx":642,"../../components/titles":697,"../../lib":735,"../../lib/extend":726,"../../registry":866,"../cartesian/axes":783,"../cartesian/constants":789,"../cartesian/select":802,"../cartesian/set_convert":803,"../plots":846,d3:165,tinycolor2:535}],866:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),h=l.extendFlat,f=l.extendDeepAll;function p(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(h[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":602,"../components/drawing":624,"../constants/xmlns_namespaces":712,"../lib":735,d3:165}],875:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rh+c||!n(u))}for(var p=0;pi))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?a+=i:e<0&&(a-=i)}return n.inbox(r-e,a-e,b+(a-e)/(a-r)-1)}"h"===m.orientation?(i=r,s=e,u="y",h="x",f=S,p=M):(i=e,s=r,u="x",h="y",p=S,f=M);var E=t[u+"a"],C=t[h+"a"];d=Math.abs(E.r2c(E.range[1])-E.r2c(E.range[0]));var L=n.getDistanceFunction(a,f,p,(function(t){return(f(t)+p(t))/2}));if(n.getClosest(g,L,t),!1!==t.index&&g[t.index].p!==c){y||(T=function(t){return Math.min(_(t),t.p-v.bargroupwidth/2)},k=function(t){return Math.max(w(t),t.p+v.bargroupwidth/2)});var P=g[t.index],I=m.base?P.b+P.s:P.s;t[h+"0"]=t[h+"1"]=C.c2p(P[h],!0),t[h+"LabelVal"]=I;var z=v.extents[v.extents.round(P.p)];return t[u+"0"]=E.c2p(y?T(P):z[0],!0),t[u+"1"]=E.c2p(y?k(P):z[1],!0),t[u+"LabelVal"]=P.p,t.labelLabel=l(E,t[u+"LabelVal"]),t.valueLabel=l(C,t[h+"LabelVal"]),t.spikeDistance=(S(P)+function(t){return A(_(t),w(t))}(P))/2-b,t[u+"Spike"]=E.c2p(P.p,!0),o(P,m,t),t.hovertemplate=m.hovertemplate,t}}function h(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=s(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n){var i=u(t,e,r,n);if(i){var o=i.cd,s=o[0].trace,l=o[i.index];return i.color=h(s,l),a.getComponentMethod("errorbars","hoverInfo")(l,s,i),[i]}},hoverOnBars:u,getTraceColor:h}},{"../../components/color":602,"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"./helpers":882}],884:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":796,"../scatter/marker_colorbar":1158,"./arrays_to_calcdata":875,"./attributes":876,"./calc":877,"./cross_trace_calc":879,"./defaults":880,"./event_data":881,"./hover":883,"./layout_attributes":885,"./layout_defaults":886,"./plot":887,"./select":888,"./style":890}],885:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],886:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return i.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,h={},f=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function C(t,e,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,c=i.anchor||"end",u="end"===c,h="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,d=a.width,g=a.height,m=Math.abs(e-t),v=Math.abs(n-r),y=m>2*_&&v>2*_?_:0;m-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=m&&g<=v||!(d>m||g>v)||(d>v||g>m)&&d.01?H:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?H(t):t>e?Math.ceil(t):Math.floor(t)};B=G(B,N,D),N=G(N,B,D),j=G(j,V,!D),V=G(V,j,!D)}var Y=A(i.ensureSingle(I,"path"),P,m,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(V-j))?"M0,0Z":"M"+B+","+j+"V"+V+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(h);l.singlePointStyle(c,Y,h,W,t)}!function(t,e,r,n,a,s,c,h,p,m,v){var w,T=e.xaxis,M=e.yaxis,L=t._fullLayout;function P(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,z="h"===I.orientation,O=function(t,e,r,n,a){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,c,h,f,p="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=a,h="x",f=n):(l="x",c=n,h="y",f=a);function g(t){return u(f,+t,!0).text}var m=e[r],v={};v.label=m.p,v.labelLabel=v[l+"Label"]=(y=m.p,u(c,y,!0).text);var y;var x=i.castOption(o,m.i,"text");(0===x||x)&&(v.text=x);v.value=m.s,v.valueLabel=v[h+"Label"]=g(m.s);var _={};b(_,o,m.i),p&&(v.delta=+m.rawS||m.s,v.deltaLabel=g(v.delta),v.final=m.v,v.finalLabel=g(v.final),v.initial=v.final-v.delta,v.initialLabel=g(v.initial));d&&(v.value=m.s,v.valueLabel=g(v.value),v.percentInitial=m.begR,v.percentInitialLabel=i.formatPercent(m.begR),v.percentPrevious=m.difR,v.percentPreviousLabel=i.formatPercent(m.difR),v.percentTotal=m.sumR,v.percenTotalLabel=i.formatPercent(m.sumR));var w=i.castOption(o,m.i,"customdata");w&&(v.customdata=w);return i.texttemplateString(s,v,t._d3locale,_,v,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function c(t){return u(o?r:n,+t,!0).text}var h,f=a.textinfo,p=t[e],d=f.split("+"),g=[],m=function(t){return-1!==d.indexOf(t)};m("label")&&g.push((v=t[e].p,u(o?n:r,v,!0).text));var v;m("text")&&(0===(h=i.castOption(a,p.i,"text"))||h)&&g.push(h);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;m("initial")&&g.push(c(b)),m("delta")&&g.push(c(y)),m("final")&&g.push(c(x))}if(l){m("value")&&g.push(c(p.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(h=i.formatPercent(p.begR),w&&(h+=" of initial"),g.push(h)),m("percent previous")&&(h=i.formatPercent(p.difR),w&&(h+=" of previous"),g.push(h)),m("percent total")&&(h=i.formatPercent(p.sumR),w&&(h+=" of total"),g.push(h))}return g.join("
")}(e,r,n,a):g.getValue(s.text,r);return g.coerceString(y,o)}(L,n,a,T,M);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(I,a);var D="stack"===m.mode||"relative"===m.mode,R=n[a],F=!D||R._outmost;if(!O||"none"===w||(R.isBlank||s===c||h===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=L.font,N=d.getBarColor(n[a],I),j=d.getInsideTextFont(I,a,B,N),V=d.getOutsideTextFont(I,a,B),U=r.datum();z?"log"===T.type&&U.s0<=0&&(s=T.range[0]=G*(X/Y):X>=Y*(Z/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){W=i.ensureUniformFontSize(t,"outside"===w?V:j);var $=(q=P(r,O,W)).attr("transform");if(q.attr("transform",""),H=l.bBox(q.node()),G=H.width,Y=H.height,q.attr("transform",$),G<=0||Y<=0)return void q.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,a,i){var o,s=!!i.isHorizontal,l=!!i.constrained,c=i.angle||0,u=a.width,h=a.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:f>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var g=S(c),m=E(a,g),v=(s?m.x:m.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);s?(b=e-M*o,T=M*v):(w=n+M*o,A=-M*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:g}}(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=C(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,f(I.type,tt,L),R.transform=tt,A(q,L,m,v).attr("transform",i.getTextTransform(tt))}(t,e,I,r,p,B,N,j,V,m,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,L,h.xcalendar,h.ycalendar)}));var j=!1===h.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,m)},toMoveInsideBar:C}},{"../../components/color":602,"../../components/drawing":624,"../../components/fx/helpers":638,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../registry":866,"./attributes":876,"./constants":878,"./helpers":882,"./style":890,"./uniform_text":892,d3:165,"fast-isnumeric":237}],888:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(i+o)/2,l]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,s=a[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:g,styleOnSelect:function(t,e,r){var a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var a,s=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,m(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(a.color=l),i.font(s,a)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(d(r,a,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":602,"../../components/drawing":624,"../../lib":735,"../../registry":866,"./attributes":876,"./helpers":882,"./uniform_text":892,d3:165}],891:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),a(t,"marker")&&i(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":602,"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613}],892:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=of.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return g(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?m+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=a.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":642,"../../lib":735,"../../plots/polar/helpers":848,"../bar/hover":883,"../scatterpolar/hover":1217}],897:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":849,"../bar/select":888,"../bar/style":890,"../scatter/marker_colorbar":1158,"../scatterpolar/format_labels":1216,"./attributes":893,"./calc":894,"./defaults":895,"./hover":896,"./layout_attributes":898,"./layout_defaults":899,"./plot":900}],898:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],899:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i,o={};function s(r,o){return n.coerce(t[i]||{},e[i],a,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var h=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,a,c,u,h,e,r)};return function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=i.ensureSingle(r,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=h.c2g(t.p0),d=t.thetag1=h.c2g(t.p1);if(a(o)&&a(s)&&a(p)&&a(d)&&o!==s&&p!==d){var g=u.c2g(t.s1),m=(p+d)/2;t.ct=[l.c2p(g*Math.cos(m)),c.c2p(g*Math.sin(m))],e=f(o,s,p,d)}else e="M0,0Z";i.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":624,"../../lib":735,"../../plots/polar/helpers":848,d3:165,"fast-isnumeric":237}],901:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../lib/extend").extendFlat,l=n.marker,c=l.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},c.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:s({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":601,"../../lib/extend":726,"../../plots/template_attributes":861,"../bar/attributes":876,"../scatter/attributes":1140}],902:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("../../constants/numerical").BADNUM,s=i._;e.exports=function(t,e){var r,l,v,y,x,b,_=t._fullLayout,w=a.getFromId(t,e.xaxis||"x"),T=a.getFromId(t,e.yaxis||"y"),k=[],A="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=w,y="x",x=T,b="y"):(v=T,y="y",x=w,b="x");var M,S,E,C,L,P,I=function(t,e,r,a){var o,s=e+"0"in t,l="d"+e in t;if(e in t||s&&l)return r.makeCalcdata(t,e);o=s?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:a;for(var c="multicategory"===r.type?r.r2c_just_indices(o):r.d2c(o,0,t[e+"calendar"]),u=t._length,h=new Array(u),f=0;fM.uf};if(e._hasPreCompStats){var F=e[y],B=function(t){return v.d2c((e[t]||[])[r])},N=1/0,j=-1/0;for(r=0;r=M.q1&&M.q3>=M.med){var U=B("lowerfence");M.lf=U!==o&&U<=M.q1?U:f(M,E,C);var q=B("upperfence");M.uf=q!==o&&q>=M.q3?q:p(M,E,C);var H=B("mean");M.mean=H!==o?H:C?i.mean(E,C):(M.q1+M.q3)/2;var G=B("sd");M.sd=H!==o&&G>=0?G:C?i.stdev(E,C,M.mean):M.q3-M.q1,M.lo=d(M),M.uo=g(M);var Y=B("notchspan");Y=Y!==o&&Y>0?Y:m(M,C),M.ln=M.med-Y,M.un=M.med+Y;var W=M.lf,Z=M.uf;e.boxpoints&&E.length&&(W=Math.min(W,E[0]),Z=Math.max(Z,E[C-1])),e.notched&&(W=Math.min(W,M.ln),Z=Math.max(Z,M.un)),M.min=W,M.max=Z}else{var X;i.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+M.q1,"median = "+M.med,"q3 = "+M.q3].join("\n")),X=M.med!==o?M.med:M.q1!==o?M.q3!==o?(M.q1+M.q3)/2:M.q1:M.q3!==o?M.q3:0,M.med=X,M.q1=M.q3=X,M.lf=M.uf=X,M.mean=M.sd=X,M.ln=M.un=X,M.min=M.max=X}N=Math.min(N,M.min),j=Math.max(j,M.max),M.pts2=S.filter(R),k.push(M)}}e._extremes[v._id]=a.findExtremes(v,[N,j],{padded:!0})}else{var J=v.makeCalcdata(e,y),K=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a=0&&tt0){var ot,st;if((M={}).pos=M[b]=O[r],S=M.pts=$[r].sort(u),C=(E=M[y]=S.map(h)).length,M.min=E[0],M.max=E[C-1],M.mean=i.mean(E,C),M.sd=i.stdev(E,C,M.mean),M.med=i.interp(E,.5),C%2&&(at||it))at?(ot=E.slice(0,C/2),st=E.slice(C/2+1)):it&&(ot=E.slice(0,C/2+1),st=E.slice(C/2)),M.q1=i.interp(ot,.5),M.q3=i.interp(st,.5);else M.q1=i.interp(E,.25),M.q3=i.interp(E,.75);M.lf=f(M,E,C),M.uf=p(M,E,C),M.lo=d(M),M.uo=g(M);var lt=m(M,C);M.ln=M.med-lt,M.un=M.med+lt,et=Math.min(et,M.ln),rt=Math.max(rt,M.un),M.pts2=S.filter(R),k.push(M)}e._extremes[v._id]=a.findExtremes(v,e.notched?J.concat([et,rt]):J,{padded:!0})}return function(t,e){if(i.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(k[0].t={num:_[A],dPos:D,posLetter:b,valLetter:y,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},_[A]++,k):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)i.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?i.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function f(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(i.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(i.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function m(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"fast-isnumeric":237}],903:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],g=0;for(s=0;s1,b=1-h[t+"gap"],_=1-h[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;H+G>=0&&((W=U*(H+G))>M?(q=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var Z=0;H-G<=0&&((Z=-U*(H-G))>S?(q=!0,V=Y,N=Z):Z>F&&(V=Y,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(m="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(m="h",v=Math.min(_)):v=0;if(v){e._length=v;var A=r("orientation",m);e._hasPreCompStats?"v"===A&&0===x?(r("x0",0),r("dx",1)):"h"===A&&0===y&&(r("y0",0),r("dy",1)):"v"===A&&0===x?r("x0"):"h"===A&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i)}else e.visible=!1}function u(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=r(i+"points",c);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var h=r("hoveron");"all"!==h&&-1===h.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function o(r,a){return n.coerce(t,e,l,r,a)}if(c(t,e,o,a),!1!==e.visible){var s=e._hasPreCompStats;s&&(o("lowerfence"),o("upperfence")),o("line.color",(t.marker||{}).color||r),o("line.width"),o("fillcolor",i.addOpacity(e.line.color,.5));var h=!1;if(s){var f=o("mean"),p=o("sd");f&&f.length&&(h=!0,p&&p.length&&(h="sd"))}o("boxmean",h),o("whiskerwidth"),o("width"),o("quartilemethod");var d=!1;if(s){var g=o("notchspan");g&&g.length&&(d=!0)}else n.validate(t.notchwidth,l.notchwidth)&&(d=!0);o("notched",d)&&o("notchwidth"),u(t,e,o,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,l,t)}for(var s=0;st.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function l(t,e,r,i){var o,s,l=e.pos,c=e.val,u=i.bPos,h=i.bPosPxOffset||0,f=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each((function(t){var e=l.c2l(t.pos+u,!0),a=l.l2p(e)+h,i=l.l2p(e-o)+h,p=l.l2p(e+s)+h,d=c.c2p(t.mean,!0),g=c.c2p(t.mean-t.sd,!0),m=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+d+","+i+"V"+p+("sd"===f?"m0,0L"+g+","+a+"L"+d+","+i+"L"+m+","+a+"Z":"")):n.select(this).attr("d","M"+i+","+d+"H"+p+("sd"===f?"m0,0L"+a+","+g+"L"+i+","+d+"L"+a+","+m+"Z":""))}))}e.exports={plot:function(t,e,r,i){var c=e.xaxis,u=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],h=i.t,f=i.trace;(h.wdPos=h.bdPos*f.whiskerwidth,!0!==f.visible||h.empty)?a.remove():("h"===f.orientation?(e=u,r=c):(e=c,r=u),o(a,{pos:e,val:r},f,h),s(a,{x:c,y:u},f,h),l(a,{pos:e,val:r},f,h))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":624,"../../lib":735,d3:165}],911:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var a=1/0,i=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,D=P(S+L),R=I(E-L),F=[[h=M(S)]];for(i=D;i*C=0;a--)i[u-a]=t[h][a],o[u-a]=e[h][a];for(s.push({x:i,y:o,bicubic:l}),a=h,i=[],o=[];a>=0;a--)i[h-a]=t[a][0],o[h-a]=e[a][0];return s.push({x:i,y:o,bicubic:c}),s}},{}],925:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var i,o,s,l,c,u,h,f,p,d,g,m,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,C=M.length,L=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function z(n){var a,i,o,s,l,c,u,h,p,d,g,m,v=[],y=[],x={};if("b"===e)for(i=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=L,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},a=0;a0&&(p=t.dxydi([],a-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],a-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(a=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,a))),u=a-c,x.length=L,x.crossLength=P,x.xy=function(e){return t.evalxy([],a,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(g=t.dxydj([],c,i-1,u,0),v.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),m=t.dxydj([],c,i-1,u,1),v.push(h[0]-m[0]/3),y.push(h[1]-m[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=f,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function O(n){var a,i,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),h.xy=function(e){return t.evalxy([],e,n)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},a=0;ax.length-1||_.push(a(O(o),{color:b.gridcolor,width:b.gridwidth}));for(f=u;fx.length-1||g<0||g>x.length-1))for(m=x[s],v=x[g],i=0;ix[x.length-1]||w.push(a(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(a(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(a(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],f=u;f<=h;f++)p=b.tick0+b.dtick*f,_.push(a(z(p),{color:b.gridcolor,width:b.gridwidth}));for(f=u-1;fx[x.length-1]||w.push(a(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(a(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(a(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":726,"../../plots/cartesian/axes":783}],926:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,i,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],a=0;a90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],940:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=t("../../constants/alignment");function h(t,e,r,a,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var a=r,s=a.x,l=a.y,c=i([],s,t.c2p),u=i([],l,e.c2p),h="M"+o(c,u,a.smoothing);n.select(this).attr("d",h).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),u.exit().remove()}function f(t,e,r,i,o,c,u,h){var f=c.selectAll("text."+h).data(u);f.enter().append("text").classed(h,!0);var p=0,d={};return f.each((function(o,c){var u;if("auto"===o.axis.tickangle)u=s(i,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;u=s(i,e,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(d={angle:u.angle,flip:u.flip});var f=(o.endAnchor?-1:1)*u.flip,g=n.select(this).attr({"text-anchor":f>0?"start":"end","data-notex":1}).call(a.font,o.font).text(o.text).call(l.convertToTspans,t),m=a.bBox(this);g.attr("transform","translate("+u.p[0]+","+u.p[1]+") rotate("+u.angle+")translate("+o.axis.labelpadding*f+","+.3*m.height+")"),p=Math.max(p,m.width+o.axis.labelpadding)})),f.exit().remove(),d.maxExtent=p,d}e.exports=function(t,e,r,a){var l=e.xaxis,u=e.yaxis,p=t._fullLayout._clips;c.makeTraceGroups(a,r,"trace").each((function(e){var r=n.select(this),a=e[0],d=a.trace,m=d.aaxis,v=d.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",d.opacity),h(l,u,x,m,"a",m._gridlines),h(l,u,x,v,"b",v._gridlines),h(l,u,y,m,"a",m._minorgridlines),h(l,u,y,v,"b",v._minorgridlines),h(l,u,b,m,"a-boundary",m._boundarylines),h(l,u,b,v,"b-boundary",v._boundarylines);var w=f(t,l,u,d,a,_,m._labels,"a-label"),T=f(t,l,u,d,a,_,v._labels,"b-label");!function(t,e,r,n,a,i,o,l){var u,h,f,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),v=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),h=v,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===o.angle&&c.extendFlat(o,s(r,a,i,f,r.dxydb_rough(u,h)));g(t,e,r,n,f,p,r.aaxis,a,i,o,"a-title"),u=d,h=.5*(v+y),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===l.angle&&c.extendFlat(l,s(r,a,i,f,r.dxyda_rough(u,h)));g(t,e,r,n,f,p,r.baxis,a,i,l,"b-title")}(t,_,d,a,l,u,w,T),function(t,e,r,n,a){var s,l,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,g=[];for(h=0;h90&&m<270,y=n.select(this);y.text(u.title.text).call(l.convertToTspans,t),v&&(x=(-l.lineCount(y)+d)*p*i-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(a.font,u.title.font)})),y.exit().remove()}},{"../../components/drawing":624,"../../constants/alignment":704,"../../lib":735,"../../lib/svg_text_utils":759,"./makepath":937,"./map_1d_array":938,"./orient_text":939,d3:165}],941:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/search").findBin,i=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[c-1],g=r[0],m=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,g-=b,m+=b,t.isVisible=function(t,e){return t>p&&tg&&ed||em},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(a(t,e),c-2)),n=e[r],i=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(i-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(a(t,r),u-2)),n=r[e],i=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(i-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,a,i){if(!i&&(ne[c-1]|ar[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(a),l=t.evalxy([],o,s);if(i){var h,f,p,d,g=0,m=0,v=[];ne[c-1]?(h=c-2,f=1,g=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ar[u-1]?(p=u-2,d=1,m=(a-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),g&&(t.dxydi(v,h,p,f,d),l[0]+=v[0]*g,l[1]+=v[1]*g),m&&(t.dxydj(v,h,p,f,d),l[0]+=v[0]*m,l[1]+=v[1]*m)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,a){var i=t.dxydi(null,e,r,n,a),o=t.dadi(e,n);return[i[0]/o,i[1]/o]},t.dxydb=function(e,r,n,a){var i=t.dxydj(null,e,r,n,a),o=t.dbdj(r,a);return[i[0]/o,i[1]/o]},t.dxyda_rough=function(e,r,n){var a=v*(n||.1),i=t.ab2xy(e+a,r,!0),o=t.ab2xy(e-a,r,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dxydb_rough=function(e,r,n){var a=y*(n||.1),i=t.ab2xy(e,r+a,!0),o=t.ab2xy(e,r-a,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":754,"./compute_control_points":929,"./constants":930,"./create_i_derivative_evaluator":931,"./create_j_derivative_evaluator":932,"./create_spline_evaluator":933}],942:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var a,i,o,s=[],l=[],c=t[0].length,u=t.length;function h(e,r){var n,a=0,i=0;return e>0&&void 0!==(n=t[r][e-1])&&(i++,a+=n),e0&&void 0!==(n=t[r-1][e])&&(i++,a+=n),r0&&i0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":735}],943:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var a=r("x"),i=a&&a.length,o=r("y"),s=o&&o.length;if(!i&&!s)return!1;if(e._cheater=!a,i&&!n(a)||s&&!n(o))e._length=null;else{var l=i?a.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":735}],944:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":601,"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scattergeo/attributes":1181}],945:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var h=0;h")}(t,h,o,f.mockAxis),[t]}},{"../../lib":735,"../../plots/cartesian/axes":783,"./attributes":944}],949:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":815,"../heatmap/colorbar":1023,"./attributes":944,"./calc":945,"./defaults":946,"./event_data":947,"./hover":948,"./plot":950,"./select":951,"./style":952}],950:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],a=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(t):o(r,a.topojson),h=[],f=[],p=0;p=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":838,"./convert":954}],958:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),showlegend:s({},o.showlegend,{dflt:!1})};s(l,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){l[t]=i[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),l.transforms=void 0,e.exports=l},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../mesh3d/attributes":1081}],959:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,a=e.v,i=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),hc&&(n.prefixBoundary=!0)}}}},{}],966:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=a(e,{isColorbar:!0});if("heatmap"===c){var h=n.extractOpts(e);r._fillgradient=h.reversescale?n.flipScale(h.colorscale):h.colorscale,r._zrange=[h.min,h.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":614,"./end_plus":974,"./make_color_map":979}],967:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],968:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,s=i.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,i,l,h){var f,p,d,g=e.contours,m=r("contours.operation");(g._operation=c[m],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===m?f=g.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),f)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,h)}},{"../../components/color":602,"../../constants/filter_ops":707,"./label_defaults":978,"fast-isnumeric":237}],969:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":707,"fast-isnumeric":237}],970:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],971:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,i,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":735,"./constraint_mapping":969,"./end_plus":974}],974:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],975:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(h,r,e),p=[s(t,e,[-f[0],-f[1]])],d=t.z.length,g=t.z[0].length,m=e.slice(),v=f.slice();for(c=0;c<1e4;c++){if(h>20?(h=a.CHOOSESADDLE[h][(f[0]||f[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[h]):delete t.crossings[u],!(f=a.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}p.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),i(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=f[0]&&(e[0]<0||e[0]>g-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===m[0]&&e[1]===m[1]&&f[0]===v[0]&&f[1]===v[1]||r&&y)break;h=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,A,M,S,E,C,L,P,I,z,O=i(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&S--,t.edgepaths[S]=C.concat(p,E));break}U||(t.edgepaths[M]=p.concat(E))}for(M=0;Mt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,g=2===p||2===d;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):a.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;h+="L"+n}if(s===t.edgepaths.length){a.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=v.EDGECOST*(1/(f-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var g=s-u,m=l-h,y=s+u,x=l+h,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.fontSize,i=e.width+a/3,o=Math.max(0,e.height-a/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[f(-i/2,-o/2),f(-i/2,o/2),f(i/2,o/2),f(i/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:i,height:o}),n.push(p)},r.drawLabels=function(t,e,r,i,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,h=r.end,f=t._input.contours;if(u>h&&(r.start=f.start=h,h=r.end=f.end=u,u=r.start),!(r.size>0))c=u===h?1:i(u,h,t.ncontours).dtick,f.size=r.size=c}}},{"../../lib":735,"../../plots/cartesian/axes":783}],983:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,i=r.contours,s=r.line,l=i.size||1,c=i.start,u="constraint"===i.type,h=!u&&"lines"===i.coloring,f=!u&&"fill"===i.coloring,p=h||f?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)}));var d=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:d.family,size:d.size,color:d.color||(h?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(f){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),p(t.level+.5*l)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*l))}})),i(t)}},{"../../components/drawing":624,"../heatmap/style":1032,"./make_color_map":979,d3:165}],984:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":612,"./label_defaults":978}],985:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=a.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a.line.color,width:a.line.width,dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../contour/attributes":963,"../heatmap/attributes":1020}],986:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../../lib"),i=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),h=t("../carpet/lookup_carpetid"),f=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=h(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var g=function(t,e){var r,u,h,f,p,d,g,m=e._carpetTrace,v=m.aaxis,y=m.baxis;v._minDtick=0,y._minDtick=0,a.isArray1D(e.z)&&i(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,f=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],f=f?y.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,g=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(g),s(g,e._emptypoints);var x=a.maxRowLength(g),b="scaled"===e.xtype?"":r,_=c(e,b,u,h,x,v),w="scaled"===e.ytype?"":f,T=c(e,w,p,d,g.length,y),k={a:_,b:T,z:g};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:g,containerStr:"",cLetter:"z"});return[k]}(t,e);return f(e,e._z),g}}},{"../../components/colorscale/calc":610,"../../lib":735,"../carpet/lookup_carpetid":936,"../contour/set_contours":982,"../heatmap/clean_2d_array":1022,"../heatmap/convert_column_xyz":1024,"../heatmap/find_empties":1026,"../heatmap/interp2d":1029,"../heatmap/make_bound_array":1030,"./defaults":987}],987:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,i,r,a)}if(u("carpet"),t.a&&t.b){if(!a(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,i,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":735,"../contour/constraint_defaults":968,"../contour/contours_defaults":970,"../contour/style_defaults":984,"../heatmap/xyz_defaults":1034,"./attributes":985}],988:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":796,"../contour/colorbar":966,"../contour/style":983,"./attributes":985,"./calc":986,"./defaults":987,"./plot":989}],989:[function(t,e,r){"use strict";var n=t("d3"),a=t("../carpet/map_1d_array"),i=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),h=t("../contour/constants"),f=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),g=t("../carpet/lookup_carpetid"),m=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),a=t.getPointAtLength(r),i=a.x-n.x,o=a.y-n.y,s=Math.sqrt(i*i+o*o);return[i/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,A=k._carpetTrace=g(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,C=k.contours,L=p(C,e,T),P="constraint"===C.type,I=C._operation,z=P?"="===I?"lines":"fill":C.coloring,O=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(L);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(L,D,R);var F,B,N,j,V=L;"constraint"===C.type&&(V=f(L,I)),function(t,e){var r,n,a,i,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=a([],F.x,_.c2p),N=a([],F.y,w.c2p),B.reverse(),N.reverse(),U.push(i(B,N,F.bicubic));var q="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,h,f,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f=0&&(f=C,d=g):Math.abs(h[1]-f[1])=0&&(f=C,d=g):s.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;y+=S(h,f),h=f}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(h,f)+"Z",h=null)}for(u=0;um&&(n.max=m);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*h.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/I),h.LABELMAX),i=0;i0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return a.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":g?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}},{"../../components/color":602,"../../components/colorscale":614,"../../constants/numerical":711,"../../lib":735,"../../lib/geojson_utils":730,"fast-isnumeric":237}],993:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),a(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":612,"../../lib":735,"./attributes":990}],994:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],995:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover");e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=a.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=function(t,e,r){if(t.hovertemplate)return;var a=(e.hi||t.hoverinfo).split("+"),i=-1!==a.indexOf("all"),o=-1!==a.indexOf("lon"),s=-1!==a.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"\xb0"}i||o&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(i||-1!==a.indexOf("text"))&&n.fillText(e,t,c);return c.join("
")}(c,u,l[0].t.labels),[s]}}},{"../../lib":735,"../../plots/cartesian/axes":783,"../scattermapbox/hover":1209}],996:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":838,"./convert":992}],998:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),s.color=function(t,e){var r=t.marker,a=e.mc||r.color,i=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(c,h),[s]}}},{"../../components/color":602,"../../lib":735,"../bar/hover":883}],1006:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../bar/select":888,"./attributes":999,"./calc":1e3,"./cross_trace_calc":1002,"./defaults":1003,"./event_data":1004,"./hover":1005,"./layout_attributes":1007,"./layout_defaults":1008,"./plot":1009,"./style":1010}],1007:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1008:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(a.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":602,"../../components/drawing":624,"../../constants/interactions":710,"../bar/style":890,"../bar/uniform_text":892,d3:165}],1011:[function(t,e,r){"use strict";var n=t("../pie/attributes"),a=t("../../plots/attributes"),i=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":726,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/template_attributes":861,"../pie/attributes":1114}],1012:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1013:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1116}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,a,r,i)}var u=c("labels"),h=c("values"),f=s(u,h),p=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,g=c("text"),m=c("texttemplate");if(m||(d=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),m||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":735,"../../plots/domain":810,"../bar/defaults":880,"../pie/defaults":1117,"./attributes":1011}],1015:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1125,"./attributes":1011,"./base_plot":1012,"./calc":1013,"./defaults":1014,"./layout_attributes":1016,"./layout_defaults":1017,"./plot":1018,"./style":1019}],1016:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1121}],1017:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":735,"./layout_attributes":1016}],1018:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot").toMoveInsideBar,l=t("../bar/uniform_text"),c=l.recordMinTextSize,u=l.clearMinTextSize,h=t("../pie/helpers"),f=t("../pie/plot"),p=f.attachFxHandlers,d=f.determineInsideTextFont,g=f.layoutAreas,m=f.prerenderTitles,v=f.positionTitleOutside,y=f.formatSliceLabel;function x(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;u("funnelarea",r),m(e,t),g(e,r._size),i.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var l=n.select(this),u=e[0],f=u.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var h,f,p=[];for(p.push(u()),h=t.length-1;h>-1;h--)if(!(f=t[h]).hidden){var d=f.v/l;c+=d,p.push(u())}var g=1/0,m=-1/0;for(h=0;h-1;h--)if(!(f=t[h]).hidden){var A=p[k+=1][0],M=p[k][1];f.TL=[-A,M],f.TR=[A,M],f.BL=w,f.BR=T,f.pxmid=(S=f.TR,E=f.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=f.TL,T=f.TR}var S,E}(e),l.each((function(){var l=n.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove(),l.each((function(l,g){if(l.hidden)n.select(this).selectAll("path,g").remove();else{l.pointNumber=l.i,l.curveNumber=f.index;var m=u.cx,v=u.cy,b=n.select(this),_=b.selectAll("path.surface").data([l]);_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),b.call(p,t,e);var w="M"+(m+l.TR[0])+","+(v+l.TR[1])+x(l.TR,l.BR)+x(l.BR,l.BL)+x(l.BL,l.TL)+"Z";_.attr("d",w),y(t,l,u);var T=h.castOption(f.textposition,l.pts),k=b.selectAll("g.slicetext").data(l.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var u=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=i.ensureUniformFontSize(t,d(f,l,r.font));u.text(l.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,h).call(o.convertToTspans,t);var p,y,x,b=a.bBox(u.node()),_=Math.min(l.BL[1],l.BR[1])+v,w=Math.max(l.TL[1],l.TR[1])+v;y=Math.max(l.TL[0],l.BL[0])+m,x=Math.min(l.TR[0],l.BR[0])+m,(p=s(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,c(f.type,p,r),e[g].transform=p,u.attr("transform",i.getTextTransform(p))}))}}));var g=n.select(this).selectAll("g.titletext").data(f.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),s=f.title.text;f._meta&&(s=i.templateString(s,f._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,f.title.font).call(o.convertToTspans,t);var l=v(u,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")}))}))}))}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../bar/plot":887,"../bar/uniform_text":892,"../pie/helpers":1119,"../pie/plot":1123,d3:165}],1019:[function(t,e,r){"use strict";var n=t("d3"),a=t("../pie/style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":892,"../pie/style_one":1125,d3:165}],1020:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../components/colorscale/attributes"),s=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=s({z:{valType:"data_array",editType:"calc"},x:s({},n.x,{impliedEdits:{xtype:"array"}}),x0:s({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:s({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:s({},n.y,{impliedEdits:{ytype:"array"}}),y0:s({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:s({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":609,"../../constants/docs":706,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1021:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),c=t("./clean_2d_array"),u=t("./interp2d"),h=t("./find_empties"),f=t("./make_bound_array"),p=t("../../constants/numerical").BADNUM;function d(t){for(var e=[],r=t.length,n=0;nI){L("x scale is not linear");break}}if(v.length&&"fast"===E){var z=(v[v.length-1]-v[0])/(v.length-1),O=Math.abs(z/100);for(_=0;_O){L("y scale is not linear");break}}}var D=a.maxRowLength(b),R="scaled"===e.xtype?"":r,F=f(e,R,g,m,D,T),B="scaled"===e.ytype?"":v,N=f(e,B,y,x,b.length,k);S||(e._extremes[T._id]=i.findExtremes(T,F),e._extremes[k._id]=i.findExtremes(k,N));var j={x:F,y:N,z:b,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(R&&R.length===F.length-1&&(j.xCenter=R),B&&B.length===N.length-1&&(j.yCenter=B),M&&(j.xRanges=w.xRanges,j.yRanges=w.yRanges,j.pts=w.pts),A||s(t,e,{vals:b,cLetter:"z"}),A&&e.contours&&"heatmap"===e.contours.coloring){var V={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=f(V,R,g,m,D,T),j.yfill=f(V,B,y,x,b.length,k)}return[j]}},{"../../components/colorscale/calc":610,"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"../histogram2d/calc":1052,"./clean_2d_array":1022,"./convert_column_xyz":1024,"./find_empties":1026,"./interp2d":1029,"./make_bound_array":1030}],1022:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,h,f;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,h=0;h=0;o--)(s=((h[[(r=(i=f[o])[0])-1,a=i[1]]]||g)[2]+(h[[r+1,a]]||g)[2]+(h[[r,a-1]]||g)[2]+(h[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in l)h[i]=l[i],u.push(l[i])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":735}],1027:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l,c){var u,h,f,p,d=t.cd[0],g=d.trace,m=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=g.zhoverformat,A=y,M=x;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(c){var S;for(A=[2*y[0]-y[1]],S=1;Sg&&(v=Math.max(v,Math.abs(t[i][o]-d)/(m-g))))}return v}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":735}],1030:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,c,u,h=[],f=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!p&&"category"!==s.type){var g=e.length;if(!(g<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f||d)h=e.slice(0,o);else if(1===o)h=[e[0]-.5,e[0]+.5];else{for(h=[1.5*e[0]-.5*e[1]],u=1;u0;)f=p.c2p(T[y]),y--;for(f0;)v=d.c2p(k[y]),y--;if(v0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]c?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,i,s){if(n&&t>o){var l=d(e,i,s),c=d(r,i,s),u=t===a?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,c=-1.1*e,f=-.1*e,p=t-f,d=r[0],g=r[1],m=Math.min(h(d+f,d+p,n,i),h(g+f,g+p,n,i)),v=Math.min(h(d+c,d+f,n,i),h(g+c,g+f,n,i));if(m>v&&vo){var y=s===a?1:6,x=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,i);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),O.start=r.l2r(j),F||a.nestedProperty(e,v+".start").set(O.start)}var V=b.end,U=r.r2l(z.end),q=void 0!==U;if((b.endFound||q)&&U!==r.r2l(V)){var H=q?U:a.aggNums(Math.max,null,d);O.end=r.l2r(H),q||a.nestedProperty(e,v+".start").set(O.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=a.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[O,d]}e.exports={calc:function(t,e){var r,i,p,d,g=[],m=[],v=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=f(t,e,v,y),T=w[0],k=w[1],A="string"==typeof T.size,M=[],S=A?M:T,E=[],C=[],L=[],P=0,I=e.histnorm,z=e.histfunc,O=-1!==I.indexOf("density");_.enabled&&O&&(I=I.replace(/ ?density$/,""),O=!1);var D,R="max"===z||"min"===z?null:0,F=l.count,B=c[I],N=!1,j=function(t){return v.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==z&&(D=e[x],N="avg"===z,F=l[z]),r=j(T.start),p=j(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(m,_.direction,_.currentbin);var J=Math.min(g.length,m.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(m[r]){$=r;break}for(r=Q;r<=$;r++)if(n(g[r])&&n(m[r])){var tt={p:g[r],s:m[r],b:0};_.enabled||(tt.pts=L[r],G?tt.ph0=tt.ph1=L[r].length?k[L[r][0]]:g[r]:(e._computePh=!0,tt.ph0=q(M[r]),tt.ph1=q(M[r+1],!0))),K.push(tt)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),s(K,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(K,e,Z),K},calcAllAutoBins:f}},{"../../lib":735,"../../plots/cartesian/axes":783,"../../registry":866,"../bar/arrays_to_calcdata":875,"./average":1039,"./bin_functions":1041,"./bin_label_vals":1042,"./norm_functions":1050,"fast-isnumeric":237}],1044:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],1045:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=a.getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,h,f,p,d,g,m,v=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,i){var o=t.uid+"__"+i;r||(r=o);var s=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),l=t[i+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(i)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[i],axType:s,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],L=[],P="string"==typeof w.size,I="string"==typeof A.size,z=[],O=[],D=P?z:w,R=I?O:A,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),q="max"===V||"min"===V?null:0,H=i.count,G=o[j],Y=!1,W=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==V&&(Y="avg"===V,H=i[V]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-a.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(o.z[h][u]){var f,p=o.hi||s.hoverinfo;if(p){var d=p.split("+");-1!==d.indexOf("all")&&(d=["color"]),-1!==d.indexOf("color")&&(f=!0)}var g,m=s.colormodel,v=m.length,y=s._scaler(o.z[h][u]),x=i.colormodel[m].suffix,b=[];(s.hovertemplate||f)&&(b.push("["+[y[0]+x[0],y[1]+x[1],y[2]+x[2]].join(", ")),4===v&&b.push(", "+y[3]+x[3]),b.push("]"),b=b.join(""),t.extraText=m.toUpperCase()+": "+b),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][u]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][u]);var _=c.c2p(o.y0+(h+.5)*s.dy),w=o.x0+(u+.5)*s.dx,T=o.y0+(h+.5)*s.dy,k="["+o.z[h][u].slice(0,s.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[h,u],x0:l.c2p(o.x0+u*s.dx),x1:l.c2p(o.x0+(u+1)*s.dx),y0:_,y1:_,color:y,xVal:w,xLabelVal:w,yVal:T,yLabelVal:T,zLabelVal:k,text:g,hovertemplateLabels:{zLabel:k,colorLabel:b,"color[0]Label":y[0]+x[0],"color[1]Label":y[1]+x[1],"color[2]Label":y[2]+x[2],"color[3]Label":y[3]+x[3]}})]}}}},{"../../components/fx":642,"../../lib":735,"./constants":1062}],1066:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":796,"./attributes":1060,"./calc":1061,"./defaults":1063,"./event_data":1064,"./hover":1065,"./plot":1067,"./style":1068}],1067:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../constants/xmlns_namespaces"),o=t("./constants");e.exports=function(t,e,r,s){var l=e.xaxis,c=e.yaxis;a.makeTraceGroups(s,r,"im").each((function(t){var e,r,s,u,h,f,p=n.select(this),d=t[0],g=d.trace,m=d.z,v=d.x0,y=d.y0,x=d.w,b=d.h,_=g.dx,w=g.dy;for(f=0;void 0===e&&f0;)r=l.c2p(v+f*_),f--;for(f=0;void 0===u&&f0;)h=c.c2p(y+f*w),f--;r0}function x(t){t.each((function(t){d.stroke(n.select(this),t.line.color)})).each((function(t){d.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function b(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,p,t,e)}return h(i,o,l,s,n),f(i,o,l,s),o}function _(t,e){return"translate("+t+","+e+")"}function w(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function T(t,e,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(c.convertToTspans,a).call(s.font,e),s.bBox(o.node())}function k(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,h){var f,p=t._fullLayout;y(r)&&h&&(f=h()),a.makeTraceGroups(p._indicatorlayer,e,"trace").each((function(e){var h,A,M,S,E,C=e[0].trace,L=n.select(this),P=C._hasGauge,I=C._isAngular,z=C._isBullet,O=C.domain,D={w:p._size.w*(O.x[1]-O.x[0]),h:p._size.h*(O.y[1]-O.y[0]),l:p._size.l+p._size.w*O.x[0],r:p._size.r+p._size.w*(1-O.x[1]),t:p._size.t+p._size.h*(1-O.y[1]),b:p._size.b+p._size.h*O.y[0]},R=D.l+D.w/2,F=D.t+D.h/2,B=Math.min(D.w/2,D.h),N=l.innerRadius*B,j=C.align||"center";if(A=F,P){if(I&&(h=R,A=F+B/2,M=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*N)}),z){var V=l.bulletPadding,U=1-l.bulletNumberDomainSize+V;h=D.l+(U+(1-U)*m[j])*D.w,M=function(t){return w(t,(l.bulletNumberDomainSize-V)*D.w,D.h)}}}else h=D.l+m[j]*D.w,M=function(t){return w(t,D.w,D.h)};!function(t,e,r,i){var o,l,h,f=r[0].trace,p=i.numbersX,x=i.numbersY,w=f.align||"center",A=g[w],M=i.transitionOpts,S=i.onComplete,E=a.ensureSingle(e,"g","numbers"),C=[];f._hasNumber&&C.push("number");f._hasDelta&&(C.push("delta"),"left"===f.delta.position&&C.reverse());var L=E.selectAll("text").data(C);function P(e,r,n,a){if(!e.match("s")||n>=0==a>=0||r(n).slice(-1).match(v)||r(a).slice(-1).match(v))return r;var i=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=b(t,{tickformat:i});return function(t){return Math.abs(t)<1?u.tickText(o,t).text:r(t)}}L.enter().append("text"),L.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),L.exit().remove();var I,z=f.mode+f.align;f._hasDelta&&(I=function(){var e=b(t,{tickformat:f.delta.valueformat},f._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=function(t){return f.delta.relative?t.relativeDelta:t.delta},o=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?f.delta.increasing.symbol:f.delta.decreasing.symbol)+e(t)},h=function(t){return t.delta>=0?f.delta.increasing.color:f.delta.decreasing.color};void 0===f._deltaLastValue&&(f._deltaLastValue=i(r[0]));var p=E.select("text.delta");function g(){p.text(o(i(r[0]),a)).call(d.fill,h(r[0])).call(c.convertToTspans,t)}return p.call(s.font,f.delta.font).call(d.fill,h({delta:f._deltaLastValue})),y(M)?p.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=n.select(this),e=i(r[0]),s=f._deltaLastValue,l=P(f.delta.valueformat,a,s,e),c=n.interpolateNumber(s,e);return f._deltaLastValue=e,function(e){t.text(o(c(e),l)),t.call(d.fill,h({delta:c(e)}))}})).each("end",(function(){g(),S&&S()})).each("interrupt",(function(){g(),S&&S()})):g(),l=T(o(i(r[0]),a),f.delta.font,A,t),p}(),z+=f.delta.position+f.delta.font.size+f.delta.font.family+f.delta.valueformat,z+=f.delta.increasing.symbol+f.delta.decreasing.symbol,h=l);f._hasNumber&&(!function(){var e=b(t,{tickformat:f.number.valueformat},f._range);e.setScale(),u.prepTicks(e);var a=function(t){return u.tickText(e,t).text},i=f.number.suffix,l=f.number.prefix,h=E.select("text.number");function p(){var e="number"==typeof r[0].y?l+a(r[0].y)+i:"-";h.text(e).call(s.font,f.number.font).call(c.convertToTspans,t)}y(M)?h.transition().duration(M.duration).ease(M.easing).each("end",(function(){p(),S&&S()})).each("interrupt",(function(){p(),S&&S()})).attrTween("text",(function(){var t=n.select(this),e=n.interpolateNumber(r[0].lastY,r[0].y);f._lastValue=r[0].y;var o=P(f.number.valueformat,a,r[0].lastY,r[0].y);return function(r){t.text(l+o(e(r))+i)}})):p(),o=T(l+a(r[0].y)+i,f.number.font,A,t)}(),z+=f.number.font.size+f.number.font.family+f.number.valueformat+f.number.suffix+f.number.prefix,h=o);if(f._hasDelta&&f._hasNumber){var O,D,R=[(o.left+o.right)/2,(o.top+o.bottom)/2],F=[(l.left+l.right)/2,(l.top+l.bottom)/2],B=.75*f.delta.font.size;"left"===f.delta.position&&(O=k(f,"deltaPos",0,-1*(o.width*m[f.align]+l.width*(1-m[f.align])+B),z,Math.min),D=R[1]-F[1],h={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:l.left+O,right:o.right,top:Math.min(o.top,l.top+D),bottom:Math.max(o.bottom,l.bottom+D)}),"right"===f.delta.position&&(O=k(f,"deltaPos",0,o.width*(1-m[f.align])+l.width*m[f.align]+B,z,Math.max),D=R[1]-F[1],h={width:o.width+l.width+B,height:Math.max(o.height,l.height),left:o.left,right:l.right+O,top:Math.min(o.top,l.top+D),bottom:Math.max(o.bottom,l.bottom+D)}),"bottom"===f.delta.position&&(O=null,D=l.height,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height,bottom:o.bottom+l.height}),"top"===f.delta.position&&(O=null,D=o.top,h={width:Math.max(o.width,l.width),height:o.height+l.height,left:Math.min(o.left,l.left),right:Math.max(o.right,l.right),top:o.bottom-o.height-l.height,bottom:o.bottom}),I.attr({dx:O,dy:D})}(f._hasNumber||f._hasDelta)&&E.attr("transform",(function(){var t=i.numbersScaler(h);z+=t[2];var e,r=k(f,"numbersScale",1,t[0],z,Math.min);f._scaleNumbers||(r=1),e=f._isAngular?x-r*h.bottom:x-r*(h.top+h.bottom)/2,f._numbersTop=r*h.top+e;var n=h[w];"center"===w&&(n=(h.left+h.right)/2);var a=p-r*n;return _(a=k(f,"numbersTranslate",0,a,z,Math.max),e)+" scale("+r+")"}))}(t,L,e,{numbersX:h,numbersY:A,numbersScaler:M,transitionOpts:r,onComplete:f}),P&&(S={range:C.gauge.axis.range,color:C.gauge.bgcolor,line:{color:C.gauge.bordercolor,width:0},thickness:1},E={range:C.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:C.gauge.bordercolor,width:C.gauge.borderwidth},thickness:1});var q=L.selectAll("g.angular").data(I?e:[]);q.exit().remove();var H=L.selectAll("g.angularaxis").data(I?e:[]);H.exit().remove(),I&&function(t,e,r,a){var s,l,c,h,f=r[0].trace,p=a.size,d=a.radius,g=a.innerRadius,m=a.gaugeBg,v=a.gaugeOutline,w=[p.l+p.w/2,p.t+p.h/2+d/2],T=a.gauge,k=a.layer,A=a.transitionOpts,M=a.onComplete,S=Math.PI/2;function E(t){var e=f.gauge.axis.range[0],r=(t-e)/(f.gauge.axis.range[1]-e)*Math.PI-S;return r<-S?-S:r>S?S:r}function C(t){return n.svg.arc().innerRadius((g+d)/2-t/2*(d-g)).outerRadius((g+d)/2+t/2*(d-g)).startAngle(-S)}function L(t){t.attr("d",(function(t){return C(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}T.enter().append("g").classed("angular",!0),T.attr("transform",_(w[0],w[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(s=b(t,f.gauge.axis)).type="linear",s.range=f.gauge.axis.range,s._id="xangularaxis",s.setScale();var P=function(t){return(s.range[0]-t.x)/(s.range[1]-s.range[0])*Math.PI+Math.PI},I={},z=u.makeLabelFns(s,0).labelStandoff;I.xFn=function(t){var e=P(t);return Math.cos(e)*z},I.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*o)},I.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return _(w[0]+d*Math.cos(t),w[1]-d*Math.sin(t))};c=function(t){return O(P(t))};if(l=u.calcTicks(s),h=u.getTickSigns(s)[2],s.visible){h="inside"===s.ticks?-1:1;var D=(s.linewidth||1)/2;u.drawTicks(t,s,{vals:l,layer:k,path:"M"+h*D+",0h"+h*s.ticklen,transFn:function(t){var e=P(t);return O(e)+"rotate("+-i(e)+")"}}),u.drawLabels(t,s,{vals:l,layer:k,transFn:c,labelFns:I})}var R=[m].concat(f.gauge.steps),F=T.selectAll("g.bg-arc").data(R);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(L).call(x),F.exit().remove();var B=C(f.gauge.bar.thickness),N=T.selectAll("g.value-arc").data([f.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var j=N.select("path");y(A)?(j.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(V=B,U=E(r[0].lastY),q=E(r[0].y),function(){var t=n.interpolate(U,q);return function(e){return V.endAngle(t(e))()}})),f._lastValue=r[0].y):j.attr("d","number"==typeof r[0].y?B.endAngle(E(r[0].y)):"M0,0Z");var V,U,q;j.call(x),N.exit().remove(),R=[];var H=f.gauge.threshold.value;H&&R.push({range:[H,H],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var G=T.selectAll("g.threshold-arc").data(R);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(L).call(x),G.exit().remove();var Y=T.selectAll("g.gauge-outline").data([v]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(x),Y.exit().remove()}(t,0,e,{radius:B,innerRadius:N,gauge:q,layer:H,size:D,gaugeBg:S,gaugeOutline:E,transitionOpts:r,onComplete:f});var G=L.selectAll("g.bullet").data(z?e:[]);G.exit().remove();var Y=L.selectAll("g.bulletaxis").data(z?e:[]);Y.exit().remove(),z&&function(t,e,r,n){var a,i,o,s,c,h=r[0].trace,f=n.gauge,p=n.layer,g=n.gaugeBg,m=n.gaugeOutline,v=n.size,_=h.domain,w=n.transitionOpts,T=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform","translate("+v.l+", "+v.t+")"),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=v.h,A=h.gauge.bar.thickness*k,M=_.x[0],S=_.x[0]+(_.x[1]-_.x[0])*(h._hasNumber||h._hasDelta?1-l.bulletNumberDomainSize:1);(a=b(t,h.gauge.axis))._id="xbulletaxis",a.domain=[M,S],a.setScale(),i=u.calcTicks(a),o=u.makeTransFn(a),s=u.getTickSigns(a)[2],c=v.t+v.h,a.visible&&(u.drawTicks(t,a,{vals:"inside"===a.ticks?u.clipEnds(a,i):i,layer:p,path:u.makeTickPath(a,c,s),transFn:o}),u.drawLabels(t,a,{vals:i,layer:p,transFn:o,labelFns:u.makeLabelFns(a,c)}));function E(t){t.attr("width",(function(t){return Math.max(0,a.c2p(t.range[1])-a.c2p(t.range[0]))})).attr("x",(function(t){return a.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*k})).attr("height",(function(t){return t.thickness*k}))}var C=[g].concat(h.gauge.steps),L=f.selectAll("g.bg-bullet").data(C);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(E).call(x),L.exit().remove();var P=f.selectAll("g.value-bullet").data([h.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(x),y(w)?P.select("rect").transition().duration(w.duration).ease(w.easing).each("end",(function(){T&&T()})).each("interrupt",(function(){T&&T()})).attr("width",Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(h.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return h.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(I);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",a.c2p(h.gauge.threshold.value)).attr("x2",a.c2p(h.gauge.threshold.value)).attr("y1",(1-h.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-h.gauge.threshold.thickness)/2)*k).call(d.stroke,h.gauge.threshold.line.color).style("stroke-width",h.gauge.threshold.line.width),z.exit().remove();var O=f.selectAll("g.gauge-outline").data([m]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(E).call(x),O.exit().remove()}(t,0,e,{gauge:G,layer:Y,size:D,gaugeBg:S,gaugeOutline:E,transitionOpts:r,onComplete:f});var W=L.selectAll("text.title").data(e);W.exit().remove(),W.enter().append("text").classed("title",!0),W.attr("text-anchor",(function(){return z?g.right:g[C.title.align]})).text(C.title.text).call(s.font,C.title.font).call(c.convertToTspans,t),W.attr("transform",(function(){var t,e=D.l+D.w*m[C.title.align],r=l.titlePadding,n=s.bBox(W.node());if(P){if(I)if(C.gauge.axis.visible)t=s.bBox(H.node()).top-r-n.bottom;else t=D.t+D.h/2-B/2-n.bottom-r;z&&(t=A-(n.top+n.bottom)/2,e=D.l-l.bulletPadding*D.w)}else t=C._numbersTop-r-n.bottom;return _(e,t)}))}))}},{"../../components/color":602,"../../components/drawing":624,"../../constants/alignment":704,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"../../plots/cartesian/axis_defaults":785,"../../plots/cartesian/layout_attributes":797,"../../plots/cartesian/position_defaults":800,"./constants":1072,d3:165}],1076:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../mesh3d/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;var c=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),showlegend:s({},o.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plots/attributes":780,"../../plots/template_attributes":861,"../mesh3d/attributes":1081}],1077:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../streamtube/calc").processGrid,i=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var r=a(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),a=Math.max(e[r],e[r-1]);if(a>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){L();var a,i,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],a=t[2],i=function(t,e,r){for(var n=[],a=0;a-1?n[p]:C(d,g,v);f[p]=x>-1?x:I(d,g,v,R(e,y))}a=f[0],i=f[1],o=f[2],t._meshI.push(a),t._meshJ.push(i),t._meshK.push(o),++m}}function B(t,e,r,n){var a=t[3];an&&(a=n);for(var i=(t[3]-a)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*t[s]+i*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function V(e){for(var r=[],n=0;n<4;n++){var a=e[n];r.push([t._x[a],t._y[a],t._z[a],t._value[a]])}return r}function U(t,e,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,a),N(e[1][3],n,a),N(e[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):i<3&&U(t,e,r,S,E,++i)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var u=e[i[0]],h=e[i[1]],f=e[i[2]],p=B(f,u,n,a),d=B(f,h,n,a);o=l(t,[d,p,u],[-1,-1,r[i[0]]])||o,o=l(t,[u,h,d],[r[i[0]],r[i[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var u=e[i[0]],h=e[i[1]],f=e[i[2]],p=B(h,u,n,a),d=B(f,u,n,a);o=l(t,[d,p,u],[-1,-1,r[i[0]]])||o,c=!0}})),o}function q(t,e,r,n){var a=!1,i=V(e),o=[N(i[0][3],r,n),N(i[1][3],r,n),N(i[2][3],r,n),N(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(a=function(t,e,r){var n=function(n,a,i){F(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,i,e)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]];if(g)a=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||a;else{var p=B(f,c,r,n),d=B(f,u,r,n),m=B(f,h,r,n);a=F(null,[p,d,m],[-1,-1,-1])||a}s=!0}})),s?a:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]],p=B(h,c,r,n),d=B(h,u,r,n),m=B(f,u,r,n),v=B(f,c,r,n);g?(a=F(t,[c,v,p],[e[l[0]],-1,-1])||a,a=F(t,[u,d,m],[e[l[1]],-1,-1])||a):a=function(t,e,r){var n=function(n,a,i){F(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(2,3,0)}(null,[p,d,m,v],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=i[l[0]],u=i[l[1]],h=i[l[2]],f=i[l[3]],p=B(u,c,r,n),d=B(h,c,r,n),m=B(f,c,r,n);g?(a=F(t,[c,p,d],[e[l[0]],-1,-1])||a,a=F(t,[c,d,m],[e[l[0]],-1,-1])||a,a=F(t,[c,m,p],[e[l[0]],-1,-1])||a):a=F(null,[p,d,m],[-1,-1,-1])||a,s=!0}})),a)}function H(t,e,r,n,a,i,o,s,l,c,u){var h=!1;return d&&(D(t,"A")&&(h=q(null,[e,r,n,i],c,u)||h),D(t,"B")&&(h=q(null,[r,n,a,l],c,u)||h),D(t,"C")&&(h=q(null,[r,i,o,l],c,u)||h),D(t,"D")&&(h=q(null,[n,i,s,l],c,u)||h),D(t,"E")&&(h=q(null,[r,n,i,l],c,u)||h)),g&&(h=q(t,[r,n,i,l],c,u)||h),h}function G(t,e,r,n,a,i,o,s){return[!0===s[0]||U(t,V([e,r,n]),[e,r,n],i,o),!0===s[1]||U(t,V([n,a,e]),[n,a,e],i,o)]}function Y(t,e,r,n,a,i,o,s,l){return s?G(t,e,r,a,n,i,o,l):G(t,r,a,n,e,i,o,l)}function W(t,e,r,n,a,i,o){var s,l,c,u,h=!1,f=function(){h=U(t,[s,l,c],[-1,-1,-1],a,i)||h,h=U(t,[c,u,s],[-1,-1,-1],a,i)||h},p=o[0],d=o[1],g=o[2];return p&&(s=z(V([k(e,r-0,n-0)])[0],V([k(e-1,r-0,n-0)])[0],p),l=z(V([k(e,r-0,n-1)])[0],V([k(e-1,r-0,n-1)])[0],p),c=z(V([k(e,r-1,n-1)])[0],V([k(e-1,r-1,n-1)])[0],p),u=z(V([k(e,r-1,n-0)])[0],V([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=z(V([k(e-0,r,n-0)])[0],V([k(e-0,r-1,n-0)])[0],d),l=z(V([k(e-0,r,n-1)])[0],V([k(e-0,r-1,n-1)])[0],d),c=z(V([k(e-1,r,n-1)])[0],V([k(e-1,r-1,n-1)])[0],d),u=z(V([k(e-1,r,n-0)])[0],V([k(e-1,r-1,n-0)])[0],d),f()),g&&(s=z(V([k(e-0,r-0,n)])[0],V([k(e-0,r-0,n-1)])[0],g),l=z(V([k(e-0,r-1,n)])[0],V([k(e-0,r-1,n-1)])[0],g),c=z(V([k(e-1,r-1,n)])[0],V([k(e-1,r-1,n-1)])[0],g),u=z(V([k(e-1,r-0,n)])[0],V([k(e-1,r-0,n-1)])[0],g),f()),h}function Z(t,e,r,n,a,i,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),H(f,e,r,n,a,i,o,s,l,c,u)):(d&&"odd"===t&&(f=null),H(f,l,s,o,i,a,n,r,e,c,u))}function X(t,e,r,n,a){for(var i=[],o=0,s=0;sMath.abs(d-M)?[A,d]:[d,M];$(e,T[0],T[1])}}var C=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?h.push([p.distRatio,0,0]):"y"===e?h.push([0,p.distRatio,0]):h.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[a]="x"===e?tt(null,u,i,o,h,r[a]):"y"===e?et(null,u,i,o,h,r[a]):rt(null,u,i,o,h,r[a]),a++),c.length>0&&(r[a]="x"===e?X(null,c,i,o,r[a]):"y"===e?J(null,c,i,o,r[a]):K(null,c,i,o,r[a]),a++)}var d=t.caps[e];d.show&&d.fill&&(O(d.fill),r[a]="x"===e?X(null,[0,b-1],i,o,r[a]):"y"===e?J(null,[0,_-1],i,o,r[a]):K(null,[0,w-1],i,o,r[a]),a++)}})),0===m&&P(),t._meshX=n,t._meshY=a,t._meshZ=i,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new c(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":614,"../../lib/gl_format_color":732,"../../lib/str2rgbarray":758,"../../plots/gl3d/zip3":836,"gl-mesh3d":291}],1079:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=i("x"),u=i("y"),h=i("z"),f=i("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),["x","y","z"].forEach((function(t){var e="caps."+t;i(e+".show")&&i(e+".fill");var r="slices."+t;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){i(t)})),o(t,e,n,i,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,a){s(t,e,r,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":612,"../../lib":735,"../../registry":866,"./attributes":1076}],1080:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":825,"./attributes":1076,"./calc":1077,"./convert":1078,"./defaults":1079}],1081:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:s({},i.lightposition.x,{dflt:1e5}),y:s({},i.lightposition.y,{dflt:1e5}),z:s({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},i.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../surface/attributes":1263}],1082:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":610}],1083:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),a=t("delaunay-triangulate"),i=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,h=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!m(t.i,h)||!m(t.j,h)||!m(t.k,h))return;n=u(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(f):t.alphahull>0?i(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;om):g=T>b,m=T;var k=l(b,_,w,T);k.pos=x,k.yc=(b+T)/2,k.i=y,k.dir=g?"increasing":"decreasing",k.x=k.pos,k.y=[w,_],p&&(k.tx=e.text[y]),d&&(k.htx=e.hovertext[y]),v.push(k)}else v.push({pos:x,empty:!0})}return e._extremes[s._id]=i.findExtremes(s,n.concat(h,u),{padded:!0}),v.length&&(v[0].t={labels:{open:a(t,"open:")+" ",high:a(t,"high:")+" ",low:a(t,"low:")+" ",close:a(t,"close:")+" "}}),v}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis),a=i.getFromId(t,e.yaxis),o=function(t,e,r){var a=r._minDiff;if(!a){var i,o=t._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(s,b):((y=a.extendFlat({},f)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b),y.name="",h.push(y),m[b]=y)}return h}function f(t,e,r,a){var i=t.cd,o=t.ya,l=i[0].trace,h=i[0].t,f=u(t,e,r,a);if(!f)return[];var p=i[f.index],d=f.index=p.i,g=p.dir;function m(t){return h.labels[t]+n.hoverLabelText(o,l[t][d])}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[m("open"),m("high"),m("low"),m("close")+" "+c[g]]:[];return _&&s(p,l,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?h(t,e,r,n):f(t,e,r,n)},hoverSplit:h,hoverOnPoints:f}},{"../../components/color":602,"../../components/fx":642,"../../constants/delta.js":705,"../../lib":735,"../../plots/cartesian/axes":783}],1090:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":796,"./attributes":1086,"./calc":1087,"./defaults":1088,"./hover":1089,"./plot":1092,"./select":1093,"./style":1094}],1091:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,a.minRowLength(o))),e._length=h,h}}},{"../../lib":735,"../../registry":866}],1092:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");e.exports=function(t,e,r,i){var o=e.xaxis,s=e.yaxis;a.makeTraceGroups(i,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],i=r.t;if(!0!==r.trace.visible||i.empty)e.remove();else{var l=i.tickLen,c=e.selectAll("path").data(a.identity);c.enter().append("path"),c.exit().remove(),c.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-l,!0),n=o.c2p(t.pos+l,!0);return"M"+r+","+s.c2p(t.o,!0)+"H"+e+"M"+e+","+s.c2p(t.h,!0)+"V"+s.c2p(t.l,!0)+"M"+n+","+s.c2p(t.c,!0)+"H"+e}))}}))}},{"../../lib":735,d3:165}],1093:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,h){function f(r,a){return n.coerce(t,e,l,r,a)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,h,f);o(e,h,f),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var g={family:h.font.family,size:Math.round(h.font.size),color:h.font.color};n.coerceFont(f,"labelfont",g);var m={family:h.font.family,size:Math.round(h.font.size/1.2),color:h.font.color};n.coerceFont(f,"tickfont",m)}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735,"../../plots/array_container_defaults":779,"../../plots/domain":810,"../parcoords/merge_length":1111,"./attributes":1095}],1099:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1095,"./base_plot":1096,"./calc":1097,"./defaults":1098,"./plot":1101}],1100:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plot_api/plot_api"),i=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),c=t("../../lib/svg_text_utils");function u(t,e,r,a){var i=t.map(D.bind(0,e,r)),l=a.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=l.selectAll("g.trace.parcats").data(i,h),m=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"})),m.append("g").attr("class","paths");var v=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);v.attr("fill",(function(t){return t.model.color}));var b=v.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);x(b),v.attr("d",(function(t){return t.svgD})),b.empty()||v.sort(p),v.exit().remove(),v.on("mouseover",d).on("mouseout",g).on("click",y),m.append("g").attr("class","dimensions");var T=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);T.enter().append("g").attr("class","dimension"),T.attr("transform",(function(t){return"translate("+t.x+", 0)"})),T.exit().remove();var k=T.selectAll("g.category").data((function(t){return t.categories}),h),A=k.enter().append("g").attr("class","category");k.attr("transform",(function(t){return"translate(0, "+t.y+")"})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),k.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),_(A);var M=k.selectAll("rect.bandrect").data((function(t){return t.bands}),h);M.each((function(){o.raiseToTop(this)})),M.attr("fill",(function(t){return t.color}));var I=M.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);M.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),w(I),M.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var z=e._fullLayout.paper_bgcolor;k.select("text.catlabel").attr("text-anchor",(function(t){return f(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",z+" -1px 1px 2px, "+z+" 1px 1px 2px, "+z+" 1px -1px 2px, "+z+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",(function(t){return f(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),c.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),k.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){s.font(n.select(this),t.parcatsViewModel.labelfont)})),k.selectAll("rect.bandrect").on("mouseover",S).on("mouseout",E),k.exit().remove(),T.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",L).on("dragend",P)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function h(t){return t.key}function f(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function p(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),C=n.mouse(h)[0];i.loneHover({trace:f,x:_-d.left+g.left,y:w-d.top+g.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:C<_?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:M,eventData:[{data:f._input,fullData:f,count:k,probability:A}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:h})}}}function g(t){if(!t.parcatsViewModel.dragDimension&&(x(n.select(this)),i.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(p),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=m(t),r=v(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:n.event,constraints:r})}}function m(t){for(var e=[],r=I(t.parcatsViewModel),n=0;n1&&c.displayInd===l.dimensions.length-1?(r=o.left,a="left"):(r=o.left+o.width,a="right");var f=s.model.count,p=s.model.categoryLabel,d=f/s.parcatsViewModel.model.count,g={countLabel:f,categoryLabel:p,probabilityLabel:d.toFixed(3)},m=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&m.push(["Count:",g.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&m.push(["P("+g.categoryLabel+"):",g.probabilityLabel].join(" "));var v=m.join("
");return{trace:u,x:r-t.left,y:h-t.top,text:v,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:u.hovertemplate,hovertemplateLabels:g,eventData:[{data:u._input,fullData:u,count:f,category:p,probability:d}]}}function S(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,a=r._fullLayout,s=a._paperdiv.node().getBoundingClientRect(),c=t.parcatsViewModel.hoveron;if("color"===c?(!function(t){var e=n.select(t).datum(),r=T(e);b(r),r.each((function(){o.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),A(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=T(t);b(e),e.each((function(){o.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),k(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===c?e=M(s,this):"color"===c?e=function(t,e){var r,a,i=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,c=s.parcatsViewModel,u=c.model.dimensions[s.model.dimensionInd],h=c.trace,f=i.y+i.height/2;c.dimensions.length>1&&u.displayInd===c.dimensions.length-1?(r=i.left,a="left"):(r=i.left+i.width,a="right");var p=s.model.categoryLabel,d=o.parcatsViewModel.model.count,g=0;o.categoryViewModel.bands.forEach((function(t){t.color===o.color&&(g+=t.count)}));var m=s.model.count,v=0;c.pathSelection.each((function(t){t.model.color===o.color&&(v+=t.model.count)}));var y=g/d,x=g/v,b=g/m,_={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",_.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color \u2229 "+p+"): "+_.probabilityLabel),w.push("P("+p+" | color): "+x.toFixed(3)),w.push("P(color | "+p+"): "+b.toFixed(3)));var T=w.join("
"),k=l.mostReadable(o.color,["black","white"]);return{trace:h,x:r-t.left,y:f-t.top,text:T,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:k,fontSize:10,idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:_,eventData:[{data:h._input,fullData:h,category:p,count:d,probability:y,categorycount:m,colorcount:v,bandcolorcount:g}]}}(s,this):"dimension"===c&&(e=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){r.push(M(t,this))})),r}(s,this)),e&&i.loneHover(e,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r})}}function E(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(x(e.pathSelection),_(e.dimensionSelection.selectAll("g.category")),w(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),i.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(p),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?A(this,"plotly_unhover",n.event):k(this,"plotly_unhover",n.event)}}function C(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],a=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=a&&a<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){i.model.dragX=n.event.x;var f=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[a];void 0!==f&&i.model.dragXp.x&&(i.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=i.model.displayInd}B(t.parcatsViewModel),F(t.parcatsViewModel),O(t.parcatsViewModel),z(t.parcatsViewModel)}}function P(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=I(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var a=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+a+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?A(t.potentialClickBand,"plotly_click",n.event.sourceEvent):k(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,B(t.parcatsViewModel),F(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){O(t.parcatsViewModel,!0),z(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function I(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+a)+" "+l[s]+","+(e[s]+a)+" "+(t[s]+r[s])+","+(e[s]+a),u+="l-"+r[s]+",0 ";return u+="Z"}function F(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),a=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),i=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return a[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),a=h(r);return"backward"===t.sortpaths&&(n.reverse(),a.reverse()),n.push(e.valueInds[0]),a.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),a.unshift(r.rawColor)),na?1:0}));for(var f=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),g=0;g0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*a;var i,o,s,l,c,u=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),g=8*(h-f)/2,m=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(m.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:i,y:null!==o.dragY?o.dragY:g,bands:[],parcatsViewModel:t},g=g+i+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){u(r,t,n,e)}},{"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/svg_text_utils":759,"../../plot_api/plot_api":770,d3:165,tinycolor2:535}],1101:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,a){var i=t._fullLayout,o=i._paper,s=i._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,a)}},{"./parcats":1100}],1102:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/plot_template":773,"../../plots/cartesian/layout_attributes":797,"../../plots/domain":810,"../../plots/font_attributes":811}],1103:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function c(t,e){return t*(1-l)+e*l}var u=n.bar.snapClose;function h(t,e){return t*(1-u)+e*u}function f(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],u=l,f=i;a*fe){f=r;break}}if(i=u,isNaN(i)&&(i=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);g&&(o.interval=l[i],o.intervalPix=d,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function _(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),x(t.parentNode)}function w(t,e){var r=b(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function T(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||w(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||v()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=b(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){_(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(w(t,e),_(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,v(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&A(r)):A(r),i.brushCallback(e),x(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(c?[i.newExtent]:[]),i.extent.length||A(r),i.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(T).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(y);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?M(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[f(0,r,t[0],[]),f(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":735,"../../lib/gup":733,"./constants":1106,d3:165}],1104:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":712,"../../plots/get_data":820,"./plot":1113,d3:165}],1105:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rh&&(n.log("parcoords traces support up to "+h+" dimensions at the moment"),d.splice(h));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),m=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),f(e,g,"values",m);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735,"../../plots/array_container_defaults":779,"../../plots/cartesian/axes":783,"../../plots/domain":810,"./attributes":1102,"./axisbrush":1103,"./constants":1106,"./merge_length":1111}],1108:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":735}],1109:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1102,"./base_plot":1104,"./calc":1105,"./defaults":1107,"./plot":1113}],1110:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function f(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*c,i.offset=2*l*n,e(i),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;iu&&(u=t[a].dim1.canvasX,o=a);0===s&&h(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(S=S.slice(0,a._length));var E,C=a.tickvals;function L(t,e){return{val:t,text:E[e]}}function P(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){E=a.ticktext,Array.isArray(E)&&E.length?E.length>C.length?E=E.slice(0,C.length):C.length>E.length&&(C=C.slice(0,E.length)):E=C.map(n.format(a.tickformat));for(var I=1;I=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==O&&(u?a.hover(f):a.unhover&&a.unhover(f),O=h)}})),z.style("opacity",(function(t){return t.pick?0:1})),u.style("background","rgba(255, 255, 255, 0)");var D=u.selectAll("."+g.cn.parcoords).data(k,h);D.exit().remove(),D.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),D.attr("transform",(function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"}));var R=D.selectAll("."+g.cn.parcoordsControlView).data(f,h);R.enter().append("g").classed(g.cn.parcoordsControlView,!0),R.attr("transform",(function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"}));var F=R.selectAll("."+g.cn.yAxis).data((function(t){return t.dimensions}),h);F.enter().append("g").classed(g.cn.yAxis,!0),R.each((function(t){L(F,t)})),z.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=v(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),F.attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),F.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;T.linePickActive(!1),t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,F.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),L(F,e),F.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return"translate("+t.xScale(t.xIndex)+", 0)"})),n.select(this).attr("transform","translate("+t.x+", 0)"),F.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,L(F,e),n.select(this).attr("transform",(function(t){return"translate("+t.x+", 0)"})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!A(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),T.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),F.exit().remove();var B=F.selectAll("."+g.cn.axisOverlays).data(f,h);B.enter().append("g").classed(g.cn.axisOverlays,!0),B.selectAll("."+g.cn.axis).remove();var N=B.selectAll("."+g.cn.axis).data(f,h);N.enter().append("g").classed(g.cn.axis,!0),N.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return d.isOrdinal(t)?e:P(t.model.dimensions[t.visibleIndex],e)})).scale(r)),l.font(N.selectAll("text"),t.model.tickFont)})),N.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),N.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=B.selectAll("."+g.cn.axisHeading).data(f,h);j.enter().append("g").classed(g.cn.axisHeading,!0);var V=j.selectAll("."+g.cn.axisTitle).data(f,h);V.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),V.text((function(t){return t.label})).each((function(e){var r=n.select(this);l.font(r,e.model.labelFont),s.convertToTspans(r,t)})).attr("transform",(function(t){var e=C(t.model.labelAngle,t.model.labelSide),r=g.axisTitleOffset;return(e.dir>0?"":"translate(0,"+(2*r+t.model.height)+")")+"rotate("+e.degrees+")translate("+-r*e.dx+","+-r*e.dy+")"})).attr("text-anchor",(function(t){var e=C(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var U=B.selectAll("."+g.cn.axisExtent).data(f,h);U.enter().append("g").classed(g.cn.axisExtent,!0);var q=U.selectAll("."+g.cn.axisExtentTop).data(f,h);q.enter().append("g").classed(g.cn.axisExtentTop,!0),q.attr("transform","translate(0,"+-g.axisExtentOffset+")");var H=q.selectAll("."+g.cn.axisExtentTopText).data(f,h);H.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(E),H.text((function(t){return I(t,!0)})).each((function(t){l.font(n.select(this),t.model.rangeFont)}));var G=U.selectAll("."+g.cn.axisExtentBottom).data(f,h);G.enter().append("g").classed(g.cn.axisExtentBottom,!0),G.attr("transform",(function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"}));var Y=G.selectAll("."+g.cn.axisExtentBottomText).data(f,h);Y.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(E),Y.text((function(t){return I(t,!1)})).each((function(t){l.font(n.select(this),t.model.rangeFont)})),m.ensureAxisBrush(B)}},{"../../components/colorscale":614,"../../components/drawing":624,"../../lib":735,"../../lib/gup":733,"../../lib/svg_text_utils":759,"../../plots/cartesian/axes":783,"./axisbrush":1103,"./constants":1106,"./helpers":1108,"./lines":1110,"color-rgba":124,d3:165}],1113:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},c={},u={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;c[r]=n.index;var a=u[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",h=r._tracePreGUI[t._fullData[c[e]]._fullInput.uid];if(void 0===h[s]){var f=i.constraintrange;h[s]=f||null}var p=t._fullData[c[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[u[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[u[e]]])}})}}},{"../../lib/prepare_regl":748,"./helpers":1108,"./parcoords":1112}],1114:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":601,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/font_attributes":811,"../../plots/template_attributes":861}],1115:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1116:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=a(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=l(c("labels"),c("values")),h=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),d=c("texttemplate");if(d||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||f&&"none"!==f){var g=c("textposition");s(t,e,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(e,n,c);var m=c("hole");if(c("title.text")){var v=c("title.position",m?"middle center":"top center");m||"middle center"!==v||(e.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":735,"../../plots/domain":810,"../bar/defaults":880,"./attributes":1114,"fast-isnumeric":237}],1118:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":638}],1119:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:u.hovertemplate||-1!==h.indexOf("name")?u.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:d.castOption(b.bgcolor,t.pts)||t.color,borderColor:d.castOption(b.bordercolor,t.pts),fontFamily:d.castOption(_.family,t.pts),fontSize:d.castOption(_.size,t.pts),fontColor:d.castOption(_.color,t.pts),nameLength:d.castOption(b.namelength,t.pts),textAlign:d.castOption(b.align,t.pts),hovertemplate:d.castOption(u.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,u)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[g(s,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[g(t,a)],i.click(e,n.event))}))}function y(t,e,r){var n=d.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=d.castOption(t._input.textfont.color,e.pts));var a=d.castOption(t.insidetextfont.family,e.pts)||d.castOption(t.textfont.family,e.pts)||r.family,i=d.castOption(t.insidetextfont.size,e.pts)||d.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function x(t,e){for(var r,n,a=0;ae&&e>n||r=-4;m-=2)v(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)v(Math.PI*(m+1),"tan")}if(h||p){for(m=4;m>=-4;m-=2)v(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)v(Math.PI*(m+.5),"rad")}}if(s||d||h){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,i.scale>=1)return i;g.push(i)}(d||p)&&((i=_(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i)),(d||f)&&((i=w(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i));for(var x=0,b=0,T=0;T=1)break}return g[x]}function _(t,e,r,n,a){e=Math.max(0,e-2*p);var i=t.width/t.height,o=A(i,n,e,r);return{scale:2*o/t.height,rCenter:T(i,o/e),rotate:k(a)}}function w(t,e,r,n,a){e=Math.max(0,e-2*p);var i=t.height/t.width,o=A(i,n,e,r);return{scale:2*o/t.width,rCenter:T(i,o/e),rotate:k(a+Math.PI/2)}}function T(t,e){return Math.cos(e)-t*e}function k(t){return(180/Math.PI*t+720)%180-90}function A(t,e,r,n){var a=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}function M(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function S(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function E(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=i.title.font.size,a=L(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,s.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(h+=u,o.x-=(1+a)*u,s.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?h*=2:-1!==i.title.position.indexOf("right")&&(h+=u,o.x+=(1+a)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=C(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function C(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function L(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function P(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(i){var x=l.castOption(a,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:d.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:d.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(a,t.i,"customdata")}}(e),_=d.getFirstFilled(a.text,e.pts);(m(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function O(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=i*n-o*a,t.textY=i*a+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;f("pie",r),x(e,t),P(e,i);var u=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var u=n.select(this),f=e[0],p=f.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,s=o.rotation*Math.PI/180,l=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ea.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=M(r,a))}(e),u.attr("stroke-linejoin","round"),u.each((function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var m=[[[],[]],[[],[]]],x=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=p.index,m[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=f.cx,u=f.cy,g=n.select(this),_=g.selectAll("path.surface").data([a]);if(_.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),g.call(v,t,e),p.pull){var w=+d.castOption(p.pull,a.pts)||0;w>0&&(o+=w*a.pxmid[0],u+=w*a.pxmid[1])}a.cxFinal=o,a.cyFinal=u;var T=p.hole;if(a.v===f.vTotal){var k="M"+(o+a.px0[0])+","+(u+a.px0[1])+L(a.px0,a.pxmid,!0,1)+L(a.pxmid,a.px0,!0,1)+"Z";T?_.attr("d","M"+(o+T*a.px0[0])+","+(u+T*a.px0[1])+L(a.px0,a.pxmid,!1,T)+L(a.pxmid,a.px0,!1,T)+"Z"+k):_.attr("d",k)}else{var A=L(a.px0,a.px1,!0,1);if(T){var M=1-T;_.attr("d","M"+(o+T*a.px1[0])+","+(u+T*a.px1[1])+L(a.px1,a.px0,!1,T)+"l"+M*a.px0[0]+","+M*a.px0[1]+A+"Z")}else _.attr("d","M"+o+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(t,a,f);var E=d.castOption(p.textposition,a.pts),C=g.selectAll("g.slicetext").data(a.text&&"none"!==E?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var g=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),m=l.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=d.castOption(t.outsidetextfont.color,e.pts)||d.castOption(t.textfont.color,e.pts)||r.color,a=d.castOption(t.outsidetextfont.family,e.pts)||d.castOption(t.textfont.family,e.pts)||r.family,i=d.castOption(t.outsidetextfont.size,e.pts)||d.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(p,a,r.font):y(p,a,r.font));g.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,m).call(c.convertToTspans,t);var v,_=s.bBox(g.node());if("outside"===E)v=S(_,a);else if(v=b(_,a,f),"auto"===E&&v.scale<1){var w=l.ensureUniformFontSize(t,p.outsidetextfont);g.call(s.font,w),v=S(_=s.bBox(g.node()),a)}var T=v.textPosAngle,k=void 0===T?a.pxmid:I(f.r,T);if(v.targetX=o+k[0]*v.rCenter+(v.x||0),v.targetY=u+k[1]*v.rCenter+(v.y||0),O(v,_),v.outside){var A=v.targetY;a.yLabelMin=A-_.height/2,a.yLabelMid=A,a.yLabelMax=A+_.height/2,a.labelExtraX=0,a.labelExtraY=0,x=!0}v.fontSize=m.size,h(p.type,v,r),e[i].transform=v,g.attr("transform",l.getTextTransform(v))}))}function L(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*f.r+","+n*f.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var _=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);if(_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=p.title.text;p._meta&&(a=l.templateString(a,p._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,p.title.font).call(c.convertToTspans,t),e="middle center"===p.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(f):E(f,i),r.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")})),x&&function(t,e){var r,n,a,i,o,s,l,c,u,h,f,p,g;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-g;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(d.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-g-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(a=3*s*Math.abs(c-h.indexOf(t)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(a),u=t[1-n][r],h=u.concat(c),p=[],f=0;fMath.abs(h)?s+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(i+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(g,p),x&&p.automargin){var w=s.bBox(u.node()),T=p.domain,k=i.w*(T.x[1]-T.x[0]),A=i.h*(T.y[1]-T.y[0]),M=(.5*k-f.r)/i.w,C=(.5*A-f.r)/i.h;a.autoMargin(t,"pie."+p.uid+".automargin",{xl:T.x[0]-M,xr:T.x[1]+M,yb:T.y[0]-C,yt:T.y[1]+C,l:Math.max(f.cx-f.r-w.left,0),r:Math.max(w.right-(f.cx+f.r),0),b:Math.max(w.bottom-(f.cy+f.r),0),t:Math.max(f.cy-f.r-w.top,0),pad:5})}}))}));setTimeout((function(){u.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:b,determineInsideTextFont:y,positionTitleOutside:E,prerenderTitles:x,layoutAreas:P,attachFxHandlers:v,computeTransform:O}},{"../../components/color":602,"../../components/drawing":624,"../../components/fx":642,"../../lib":735,"../../lib/svg_text_utils":759,"../../plots/plots":846,"../bar/constants":878,"../bar/uniform_text":892,"./event_data":1118,"./helpers":1119,d3:165}],1124:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":892,"./style_one":1125,d3:165}],1125:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,s=a(i.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":602,"./helpers":1119}],1126:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1140}],1127:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),i=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,h=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(h){if(n=h,e=h.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),m=a(t.marker.border.color),v=t.opacity*t.marker.opacity;g[3]*=v,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,m[3]*=v,this.pointcloudOptions.borderColor=m;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=i(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=i(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":758,"../../plots/cartesian/autorange":782,"../scatter/get_trace_color":1150,"gl-pointcloud2d":302}],1128:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":735,"./attributes":1126}],1129:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":823,"../scatter3d/calc":1168,"./attributes":1126,"./convert":1127,"./defaults":1128}],1130:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/attributes"),i=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,h=t("../../lib/extend").extendFlat,f=t("../../plot_api/edit_types").overrideAll;t("../../constants/docs").FORMAT_LINK;(e.exports=f({hoverinfo:h({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":601,"../../components/colorscale/attributes":609,"../../components/fx/attributes":633,"../../constants/docs":706,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plot_api/plot_template":773,"../../plots/attributes":780,"../../plots/domain":810,"../../plots/font_attributes":811,"../../plots/template_attributes":861}],1131:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),h=t("../../registry");function f(t,e){var r=t._fullData[e],n=t._fullLayout,a=n.dragmode,i="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==a&&"zoom"!==a){s(o,i);var f={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,a=t._fullData[e],i=a.node.groups.slice(),o=[];function s(t){for(var e=a._sankey.graph.nodes,r=0;ry&&(y=i.source[e]),i.target[e]>y&&(y=i.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(C,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(C)||w[E]!==w[C])){w.hasOwnProperty(C)&&(C=w[C]),w.hasOwnProperty(E)&&(E=w[E]),C=+C,f[E=+E]=f[C]=!0;var L="";i.label&&i.label[e]&&(L=i.label[e]);var P=null;L&&p.hasOwnProperty(L)&&(P=p[L]),c.push({pointNumber:e,label:L,color:u?i.color[e]:i.color,customdata:h?i.customdata[e]:i.customdata,concentrationscale:P,source:E,target:C,value:+S}),M.source.push(E),M.target.push(C)}}var I=b+_.length,z=o(r.color),O=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:z?r.color[e]:r.color,customdata:O?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var i=a.init2dArray(t,0),o=0;o1}))}(I,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":614,"../../lib":735,"../../lib/gup":733,"strongly-connected-components":528}],1133:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1134:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function h(t,e){function r(r,i){return n.coerce(t,e,a.link.colorscales,r,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,a,r,i)}var d=n.extendDeep(f.hoverlabel,t.hoverlabel),g=t.node,m=c.newContainer(e,"node");function v(t,e){return n.coerce(g,m,a.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(g,m,v,d),v("hovertemplate");var y=f.colorway;v("color",m.label.map((function(t,e){return i.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,a.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(f.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:h}),s(e,f,p),p("orientation"),p("valueformat"),p("valuesuffix"),m.x.length&&m.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},f.font)),e._length=null}},{"../../components/color":602,"../../components/fx/hoverlabel_defaults":640,"../../lib":735,"../../plot_api/plot_template":773,"../../plots/array_container_defaults":779,"../../plots/domain":810,"./attributes":1130,tinycolor2:535}],1135:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1130,"./base_plot":1131,"./calc":1132,"./defaults":1134,"./plot":1136,"./select.js":1138}],1136:[function(t,e,r){"use strict";var n=t("d3"),a=t("./render"),i=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,c=s._;function u(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function f(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function p(t){n.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function v(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+l.sankeyNode).filter(g(t)).call(m)}function x(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),a&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(l.sankeyNode).filter(g(t)).call(v)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,h=r._size,d=0;d"),color:b(s,"bgcolor")||o.addOpacity(d.color,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:n.event.x"),color:b(o,"bgcolor")||a.tinyColorHue,borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),nameLength:b(o,"namelength"),textAlign:b(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});f(y,.85),p(y)}}},unhover:function(e,a,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(v,a,o),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:n.event,points:[a.node]})),i.loneUnhover(r._hoverlayer.node()))},select:function(e,r,a){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(v,r,a),i.click(t,{target:!0})}}})}},{"../../components/color":602,"../../components/fx":642,"../../lib":735,"./constants":1133,"./render":1137,d3:165}],1137:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),c=t("@plotly/d3-sankey-circular"),u=t("d3-force"),h=t("../../lib"),f=t("../../lib/gup"),p=f.keyFun,d=f.repeat,g=f.unwrap,m=t("d3-interpolate").interpolateNumber,v=t("../../registry");function y(t,e,r){var a,o=g(e),s=o.trace,u=s.domain,f="h"===s.orientation,p=s.node.pad,d=s.node.thickness,m=t.width*(u.x[1]-u.x[0]),v=t.height*(u.y[1]-u.y[0]),y=o._nodes,x=o._links,b=o.circular;(a=b?c.sankeyCircular().circularLinkGap(0):l.sankey()).iterations(n.sankeyIterations).size(f?[m,v]:[v,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(y).links(x);var _,w,T,k=a();for(var A in a.nodePadding()=a||(r=a-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),a=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),a=[],i=-1,o=-1/0;for(_=0;_o+d&&(i+=1,e=s.x0),o=s.x0,a[i]||(a[i]=[]),a[i].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return a}(y=k.nodes));a.update(k)}return{circular:b,key:r,trace:s,guid:h.randstr(),horizontal:f,width:m,height:v,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?v:m,dragPerpendicular:f?m:v,arrangement:s.arrangement,sankey:a,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function x(t,e,r){var n=i(e.color),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:b,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function b(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,i=t.link.target.x0,o=m(a,i),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,f=t.link.y1+t.link.width/2;return"M"+a+","+c+"C"+s+","+c+" "+l+","+h+" "+i+","+h+"L"+i+","+f+"C"+l+","+f+" "+s+","+u+" "+a+","+u+"Z"}}function _(t,e){var r=i(e.color),a=n.nodePadAcross,s=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var l=e.dx,c=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(l),visibleHeight:c,zoneX:-a,zoneY:-s,zoneWidth:l+2*a,zoneHeight:c+2*s,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:o.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function w(t){t.attr("transform",(function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"}))}function T(t){t.call(w)}function k(t,e){t.call(T),e.attr("d",b())}function A(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function M(t){return t.link.width>1||t.linkLineWidth>0}function S(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function E(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function C(t){return a.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function L(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function P(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function I(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function z(t){return t.horizontal&&t.left?"100%":"0%"}function O(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,a){!function(t){for(var e=0;e0&&a.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,a),function(t,e,r,a,i){window.requestAnimationFrame((function o(){var s;for(s=0;s0)window.requestAnimationFrame(o);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),k(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e5?t.node.label:""})).attr("text-anchor",(function(t){return t.horizontal&&t.left?"end":"start"})),q.transition().ease(n.ease).duration(n.duration).attr("startOffset",z).style("fill",I)}},{"../../components/color":602,"../../components/drawing":624,"../../lib":735,"../../lib/gup":733,"../../registry":866,"./constants":1133,"@plotly/d3-sankey":56,"@plotly/d3-sankey-circular":55,d3:165,"d3-force":158,"d3-interpolate":160,tinycolor2:535}],1138:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,a=n._sankey.graph.nodes,i=0;is&&A[m].gap;)m--;for(y=A[m].s,d=A.length-1;d>m;d--)A[d].s=y;for(;sM[u]&&u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],1147:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./stack_defaults"),u=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),p=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function m(r,a){return n.coerce(t,e,i,r,a)}var v=l(t,e,g,m);if(v||(e.visible=!1),e.visible){var y=c(t,e,g,m),x=!y&&vG!=(F=I[L][1])>=G&&(O=I[L-1][0],D=I[L][0],F-R&&(z=O+(D-O)*(G-R)/(F-R),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var Y=s.defaultLine;return s.opacity(h.fillcolor)?Y=h.fillcolor:s.opacity((h.line||{}).color)&&(Y=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:Y,hovertemplate:!1}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":602,"../../components/fx":642,"../../lib":735,"../../registry":866,"./get_trace_color":1150}],1152:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"./arrays_to_calcdata":1139,"./attributes":1140,"./calc":1141,"./cross_trace_calc":1145,"./cross_trace_defaults":1146,"./defaults":1147,"./format_labels":1149,"./hover":1151,"./marker_colorbar":1158,"./plot":1160,"./select":1161,"./style":1163,"./subtypes":1164}],1153:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"../../lib":735}],1154:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,h=t("./constants");e.exports=function(t,e){var r,n,i,f,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S=e.xaxis,E=e.yaxis,C="log"===S.type,L="log"===E.type,P=S._length,I=E._length,z=e.connectGaps,O=e.baseTolerance,D=e.shape,R="linear"===D,F=e.fill&&"none"!==e.fill,B=[],N=h.minTolerance,j=t.length,V=new Array(j),U=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?E.l2p(n.y):E.c2p(n.y);if(i===a){if(C&&(i=S.c2p(n.x,!0)),i===a)return!1;L&&l===a&&(i*=Math.abs(S._m*I*(S._m>0?o:s)/(E._m*P*(E._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=E.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function H(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,c=a*o+i*s;if(c>0&&crt||t[1]at)return[u(t[0],et,rt),u(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var c=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===V[U-1][0],a=r===V[U-1][1];if(!n||!a)if(U>1){var i=e===V[U-2][0],o=r===V[U-2][1];n&&(e===et||e===rt)&&i?o?U--:V[U-1]=t:a&&(r===nt||r===at)&&o?i?U--:V[U-1]=t:V[U++]=t}else V[U++]=t}function ut(t){V[U-1][0]!==t[0]&&V[U-1][1]!==t[1]&&ct([X,J]),ct(t),K=null,X=J=0}function ht(t){if(A=t[0]/P,M=t[1]/I,W=t[0]rt?rt:0,Z=t[1]at?at:0,W||Z){if(U)if(K){var e=$(K,t);e.length>1&&(ut(e[0]),V[U++]=e[1])}else Q=$(V[U-1],t)[0],V[U++]=Q;else V[U++]=[W||t[0],Z||t[1]];var r=V[U-1];W&&Z&&(r[0]!==W||r[1]!==Z)?(K&&(X!==W&&J!==Z?ct(X&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[X||W,J||Z]):X&&J&&ct([X,J])),ct([W,Z])):X-W&&J-Z&&ct([W||X,Z||J]),K=t,X=W,J=Z}else K&&ut($(K,t)[0]),V[U++]=t;var n,a,i,o}for("linear"===D||"spline"===D?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=c(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ft))break;i=d,(_=v[0]*m[0]+v[1]*m[1])>x?(x=_,f=d,g=!1):_=t.length||!d)break;ht(d),n=d}}else ht(f)}K&&ct([X||K[0],J||K[1]]),B.push(V.slice(0,U))}return B}},{"../../constants/numerical":711,"../../lib":735,"./constants":1144}],1155:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1156:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,c={},u=!1,h=-1,f=0,p=-1;for(i=0;i=0?l=p:(l=p=f,f++),l0?Math.max(e,a):0}}},{"fast-isnumeric":237}],1158:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1159:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":602,"../../components/colorscale/defaults":612,"../../components/colorscale/helpers":613,"./subtypes":1164}],1160:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),h=t("./link_traces"),f=t("../../lib/polygon").tester;function p(t,e,r,h,p,d,g){var m;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),h=n.extent(i.simpleMap(l.range,l.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var d=a.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),g=Math.ceil(d.length/p),m=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=h[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var E,C;y(T).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),h[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,z="",O=[],D=_._prevtrace;D&&(z=D._prevRevpath||"",C=D._nextFill,O=D._polygons);var R,F,B,N,j,V,U,q="",H="",G=[],Y=i.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(h),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(h,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),m=0;m1){var r=n.select(this);if(r.datum(h),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),l.singleLineStyle(h,a)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(h),N&&V&&(L?("y"===L?N[1]=V[1]=b.c2p(0,!0):"x"===L&&(N[0]=V[0]=x.c2p(0,!0)),y(E).attr("d","M"+V+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):y(E).attr("d",q+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(C).attr("d",q+"Z"+z+"Z").call(l.singleFillStyle):y(C).attr("d",q+"L"+z.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(O)):(X(C),_._polygons=null)),_._prevRevpath=H,_._prevPolygons=U):(E?X(E):C&&X(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(h),S.datum(h),function(e,a,i){var o,u=i[0].trace,h=c.hasMarkers(u),f=c.hasText(u),p=tt(u),d=et,g=et;if(h||f){var m=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?m=w?K:J:_&&!w&&(m=Q),h&&(d=m),f&&(g=m)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),h&&(T=l.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,x,b)?(l.singlePointStyle(e,i,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,h);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,f,d=!i,g=!!i&&i.duration>0,m=h(t,e,r);((u=a.selectAll("g.trace").data(m,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){i[t]=null})).remove(),u.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(t,n,e,r,m,this,i)}))}))):u.each((function(r,n){p(t,n,e,r,m,this,i)}));d&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":624,"../../lib":735,"../../lib/polygon":747,"../../registry":866,"./line_points":1154,"./link_traces":1156,"./subtypes":1164,d3:165}],1161:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r0){var f=a.c2l(u);a._lowerLogErrorBound||(a._lowerLogErrorBound=f),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,f)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[a(t.x,t.error_x,e[0],r.xaxis),a(t.y,t.error_y,e[1],r.yaxis),a(t.z,t.error_z,e[2],r.zaxis)],i=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,a){var i=null;if(l.isArrayOrTypedArray(t)){i=[];for(var o=0;o=0){var g=function(t,e,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n=0&&h("surfacecolor",f||p);for(var d=["x","y","z"],g=0;g<3;++g){var m="projection."+d[g];h(m+".show")&&(h(m+".opacity"),h(m+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,f||p||r,{axis:"z"}),v(t,e,f||p||r,{axis:"y",inherit:"z"}),v(t,e,f||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":735,"../../registry":866,"../scatter/line_defaults":1153,"../scatter/marker_defaults":1159,"../scatter/subtypes":1164,"../scatter/text_defaults":1165,"./attributes":1167}],1172:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":709,"../../plots/gl3d":825,"./attributes":1167,"./calc":1168,"./convert":1170,"./defaults":1171}],1173:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:i()}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1174:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,h,f=e._length,p=new Array(f),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,m.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":735,"../scatter/hover":1151}],1179:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1173,"./calc":1174,"./defaults":1175,"./event_data":1176,"./format_labels":1177,"./hover":1178,"./plot":1180}],1180:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../plots/cartesian/axes"),i=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,h={xaxis:a.getFromId(t,u.xaxis||"x"),yaxis:a.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,h,r,o),s=0;s")}(c,g,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../scatter/get_trace_color":1150,"./attributes":1181}],1187:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":815,"../scatter/marker_colorbar":1158,"../scatter/style":1163,"./attributes":1181,"./calc":1182,"./defaults":1183,"./event_data":1184,"./format_labels":1185,"./hover":1186,"./plot":1188,"./select":1189,"./style":1190}],1188:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,h=t("../scatter/subtypes"),f=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,a=t[0].trace,o=e[a.geo],h=o._subplot,f=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):i(a,h.topojson);for(r=0;r=g,T=2*_,k={},A=e._x=y.makeCalcdata(e,"x"),M=e._y=x.makeCalcdata(e,"y"),S=new Array(T);for(r=0;r<_;r++)o=A[r],s=M[r],S[2*r]=o===d?NaN:o,S[2*r+1]=s===d?NaN:s;if("log"===y.type)for(r=0;r1&&a.extendFlat(s.line,f.linePositions(t,r,n));if(s.errorX||s.errorY){var l=f.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},f.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},f.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},f.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,S,A,M),P=p(t,b);return u(v,e),w?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=l(e,_),c(t,e,y,x,A,M,C),L.errorX&&m(e,y,L.errorX),L.errorY&&m(e,x,L.errorY),L.fill&&!P.fill2d&&(P.fill2d=!0),L.marker&&!P.scatter2d&&(P.scatter2d=!0),L.line&&!P.line2d&&(P.line2d=!0),!L.errorX&&!L.errorY||P.error2d||(P.error2d=!0),L.text&&!P.glText&&(P.glText=!0),L.marker&&(L.marker.snap=_),P.lineOptions.push(L.line),P.errorXOptions.push(L.errorX),P.errorYOptions.push(L.errorY),P.fillOptions.push(L.fill),P.markerOptions.push(L.marker),P.markerSelectedOptions.push(L.markerSel),P.markerUnselectedOptions.push(L.markerUnsel),P.textOptions.push(L.text),P.textSelectedOptions.push(L.textSel),P.textUnselectedOptions.push(L.textUnsel),P.selectBatch.push([]),P.unselectBatch.push([]),k._scene=P,k.index=P.count,k.x=A,k.y=M,k.positions=S,P.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":711,"../../lib":735,"../../plots/cartesian/autorange":782,"../../plots/cartesian/axis_ids":786,"../scatter/calc":1141,"../scatter/colorscale_calc":1143,"./constants":1193,"./convert":1194,"./scene_update":1202,"point-cluster":474}],1193:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1194:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,h=t("../scatter/subtypes"),f=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,h=o.size,f=o.family,p={},d=e.texttemplate;if(d){p.text=[];var g=a._d3locale,m=Array.isArray(d),y=m?Math.min(d.length,i):i,x=m?function(t){return d[t]}:function(){return d};for(r=0;rd.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var f=n[0],p=n[1];for(a=0;a1?l[a]:l[0]:l,d=Array.isArray(c)?c.length>1?c[a]:c[0]:c,g=m[p],v=m[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[a]=[g*y/f,x/f]}}return o}}},{"../../components/drawing":624,"../../components/fx/helpers":638,"../../constants/interactions":710,"../../lib":735,"../../lib/gl_format_color":732,"../../plots/cartesian/axis_ids":786,"../../registry":866,"../scatter/make_bubble_size_func":1157,"../scatter/subtypes":1164,"./constants":1193,"./helpers":1198,"color-normalize":122,"fast-isnumeric":237,"svg-path-sdf":533}],1195:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),f=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,d){function g(r,a){return n.coerce(t,e,o,r,a)}var m=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=l.isBubble(t),y=c(t,e,d,g);if(y){var x=y100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1193}],1199:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,h=t.index,f={pointNumber:h,x:e[h],y:r[h]};f.tx=Array.isArray(o.text)?o.text[h]:o.text,f.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,f.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,f.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var p=o.textfont;p&&(f.ts=a.isArrayOrTypedArray(p.size)?p.size[h]:p.size,f.tc=Array.isArray(p.color)?p.color[h]:p.color,f.tf=Array.isArray(p.family)?p.family[h]:p.family);var d=o.marker;d&&(f.ms=a.isArrayOrTypedArray(d.size)?d.size[h]:d.size,f.mo=a.isArrayOrTypedArray(d.opacity)?d.opacity[h]:d.opacity,f.mx=a.isArrayOrTypedArray(d.symbol)?d.symbol[h]:d.symbol,f.mc=a.isArrayOrTypedArray(d.color)?d.color[h]:d.color);var g=d&&d.line;g&&(f.mlc=Array.isArray(g.color)?g.color[h]:g.color,f.mlw=a.isArrayOrTypedArray(g.width)?g.width[h]:g.width);var m=d&&d.gradient;m&&"none"!==m.type&&(f.mgt=Array.isArray(m.type)?m.type[h]:m.type,f.mgc=Array.isArray(m.color)?m.color[h]:m.color);var v=s.c2p(f.x,!0),y=l.c2p(f.y,!0),x=f.mrc||1,b=o.hoverlabel;b&&(f.hbg=Array.isArray(b.bgcolor)?b.bgcolor[h]:b.bgcolor,f.hbc=Array.isArray(b.bordercolor)?b.bordercolor[h]:b.bordercolor,f.hts=a.isArrayOrTypedArray(b.font.size)?b.font.size[h]:b.font.size,f.htc=Array.isArray(b.font.color)?b.font.color[h]:b.font.color,f.htf=Array.isArray(b.font.family)?b.font.family[h]:b.font.family,f.hnl=a.isArrayOrTypedArray(b.namelength)?b.namelength[h]:b.namelength);var _=o.hoverinfo;_&&(f.hi=Array.isArray(_)?_[h]:_);var w=o.hovertemplate;w&&(f.ht=Array.isArray(w)?w[h]:w);var T={};T[t.index]=f;var k=a.extendFlat({},t,{color:i(o,f),x0:v-x,x1:v+x,xLabelVal:f.x,y0:y-x,y1:y+x,yLabelVal:f.y,cd:T,distance:c,spikeDistance:u,hovertemplate:f.ht});return f.htx?k.text=f.htx:f.tx?k.text=f.tx:o.text&&(k.text=o.text),a.fillText(f,o,k),n.getComponentMethod("errorbars","hoverInfo")(f,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,c,u,h,f,p,d=t.cd,g=d[0].t,m=d[0].trace,v=t.xa,y=t.ya,x=g.x,b=g.y,_=v.c2p(e),w=y.c2p(r),T=t.distance;if(g.tree){var k=v.p2c(_-T),A=v.p2c(_+T),M=y.p2c(w-T),S=y.p2c(w+T);a="x"===n?g.tree.range(Math.min(k,A),Math.min(y._rl[0],y._rl[1]),Math.max(k,A),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(k,A),Math.min(M,S),Math.max(k,A),Math.max(M,S))}else a=g.ids;var E=T;if("x"===n)for(c=0;c-1;c--)s=x[a[c]],l=b[a[c]],u=v.c2p(s)-_,h=y.c2p(l)-w,(f=Math.sqrt(u*u+h*h))v.glText.length){var w=b-v.glText.length;for(d=0;dr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var h,f,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(h=0;hh&&isNaN(d[f+1]);)f-=2;0!==d[h+1]&&(p=[d[h],0]),p=p.concat(d.slice(h,f+2)),0!==d[f+1]&&(p=p.concat([d[f],0]))}else if("tozerox"===s.fill){for(h=0;hh&&isNaN(d[f]);)f-=2;0!==d[h]&&(p=[0,d[h+1]]),p=p.concat(d.slice(h,f+2)),0!==d[f]&&(p=p.concat([0,d[f+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],a=0,i=0;i-1;for(d=0;d=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=f.project([n,i]),l=o.x-u.c2p([d,i]),c=o.y-h.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)}),t),!1!==t.index){var g=l[t.index],m=g.lonlat,v=[a.modHalf(m[0],360)+p,m[1]],y=u.c2p(v),x=h.c2p(v),b=g.mrc||1;t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b;var _={};_[c.subplot]={_subplot:f};var w=c._module.formatLabels(g,c,_);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=i(c,g),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),a=-1!==n.indexOf("all"),i=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"\xb0"}a||i&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):i?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(a||-1!==n.indexOf("text"))&&o(e,t,c);return c.join("
")}(c,g,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":642,"../../constants/numerical":711,"../../lib":735,"../scatter/get_trace_color":1150}],1210:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":840,"../scatter/marker_colorbar":1158,"../scattergeo/calc":1182,"./attributes":1204,"./defaults":1206,"./event_data":1207,"./format_labels":1208,"./hover":1209,"./plot":1211,"./select":1212}],1211:[function(t,e,r){"use strict";var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(t.gd,e),l=a.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,a(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:a}},{"../scatter/hover":1151}],1218:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":849,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1213,"./calc":1214,"./defaults":1215,"./format_labels":1216,"./hover":1217,"./plot":1219}],1219:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!f.fill2d&&(f.fill2d=!0),y.marker&&!f.scatter2d&&(f.scatter2d=!0),y.line&&!f.line2d&&(f.line2d=!0),y.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(y.line),f.fillOptions.push(y.fill),f.markerOptions.push(y.marker),f.markerSelectedOptions.push(y.markerSel),f.markerUnselectedOptions.push(y.markerUnsel),f.textOptions.push(y.text),f.textSelectedOptions.push(y.textSel),f.textUnselectedOptions.push(y.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=m,d.theta=v,d.positions=_,d._scene=f,d.index=f.count,f.count++}})),i(t,e,r)}}},{"../../lib":735,"../scattergl/constants":1193,"../scattergl/convert":1194,"../scattergl/plot":1201,"../scattergl/scene_update":1202,"fast-isnumeric":237,"point-cluster":474}],1227:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/template_attributes").texttemplateAttrs,i=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=i.marker,h=i.line,f=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},i.hovertext,{}),line:{color:h.color,width:h.width,dash:l,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:c({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":609,"../../components/drawing/attributes":623,"../../lib/extend":726,"../../plots/attributes":780,"../../plots/template_attributes":861,"../scatter/attributes":1140}],1228:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,h,f,p,d,g=t._fullLayout[e.subplot].sum,m=e.sum||g,v={a:e.a,b:e.b,c:e.c};for(r=0;r"),o.hovertemplate=f.hovertemplate,i}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":1151}],1233:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":862,"../scatter/marker_colorbar":1158,"../scatter/select":1161,"../scatter/style":1163,"./attributes":1227,"./calc":1228,"./defaults":1229,"./event_data":1230,"./format_labels":1231,"./hover":1232,"./plot":1234}],1234:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":1160}],1235:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,c=t("../../lib/extend").extendFlat,u=n.marker,h=u.line,f=c(a("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),p=c(a("marker"),{symbol:u.symbol,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:f,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:c({},o.text,{}),hovertext:c({},o.hovertext,{}),hovertemplate:i(),marker:p,xaxes:d("x"),yaxes:d("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/plot_template":773,"../../plots/cartesian/constants":789,"../../plots/template_attributes":861,"../scatter/attributes":1140,"../scattergl/attributes":1191}],1236:[function(t,e,r){"use strict";var n=t("regl-line2d"),a=t("../../registry"),i=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,c=t("../../plots/cartesian/axes").shouldShowZeroLine;function u(t,e,r){for(var n=r.matrixOptions.data.length,a=e._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;of?2*(b.sizeAvg||Math.max(b.size,3)):i(e,x),p=0;pi&&l||a-1,M=!0;if(o(x)||!!p.selectedpoints||A){var S=p._length;if(p.selectedpoints){g.selectBatch=p.selectedpoints;var E=p.selectedpoints,C={};for(l=0;l1&&(u=g[y-1],f=m[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){y=0,M=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,a=t.dataScale,u=e._len,h={};function d(t,e){var n=r[e],o=a[c[e]];return i.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(h.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var g=d(e._Xs,"xaxis"),m=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(h.meshgrid=[g,m,v],h.gridFill=e._gridFill,e._slen)h.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=m[0],x=f(g),b=f(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(m.length,x.length),l=function(t){return A(m[t])&&M(t)},h=function(t){return String(m[t])}):(r=Math.min(y.length,x.length),l=function(t){return A(y[t])&&M(t)},h=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=i.randstr(),I=0;I"),name:k||z("name")?l.name:void 0,color:T("hoverlabel.bgcolor")||y.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:k,hovertemplateLabels:L,eventData:[h(a,l,f.eventDataKeys)]};m&&(R.x0=S-a.rInscribed*a.rpx1,R.x1=S+a.rInscribed*a.rpx1,R.idealAlign=a.pxmid[0]<0?"left":"right"),v&&(R.x=S,R.idealAlign=S<0?"left":"right"),o.loneHover(R,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r}),d._hasHoverLabel=!0}if(v){var F=t.select("path.surface");f.styleOne(F,a,l,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:[h(a,l,f.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var a=r._fullLayout,i=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[h(s,i,f.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(a._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");f.styleOne(l,s,i,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,i=r._fullData[d.index],s=m&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(g,u):c.findEntryWithLevel(g,u),v=c.getPtId(p),y={points:[h(t,i,f.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[h(t,i,f.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){a.call("_storeDirectGUIEdit",i,e._tracePreGUI[i.uid],{level:i.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),a.call("animate",r,b,_)}}))}},{"../../components/fx":642,"../../components/fx/helpers":638,"../../lib":735,"../../lib/events":725,"../../registry":866,"../pie/helpers":1119,"./helpers":1257,d3:165}],1257:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var a=t.children||[],i=0;i0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var a=e?[n.data[e]]:[n];return r.listPath(n,e).concat(a)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":602,"../../lib":735,"../../lib/setcursor":755,"../pie/helpers":1119}],1258:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1158,"./attributes":1251,"./base_plot":1252,"./calc":1253,"./defaults":1255,"./layout_attributes":1259,"./layout_defaults":1260,"./plot":1261,"./style":1262}],1259:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1260:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":735,"./layout_attributes":1259}],1261:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-hierarchy"),i=t("../../components/drawing"),o=t("../../lib"),s=t("../../lib/svg_text_utils"),l=t("../bar/uniform_text"),c=l.recordMinTextSize,u=l.clearMinTextSize,h=t("../pie/plot"),f=h.computeTransform,p=h.transformInsideText,d=t("./style").styleOne,g=t("../bar/style").resizeText,m=t("./fx"),v=t("./constants"),y=t("./helpers");function x(t,e,l,u){var h=t._fullLayout,g=!h.uniformtext.mode&&y.hasTransition(u),x=n.select(l).selectAll("g.slice"),_=e[0],w=_.trace,T=_.hierarchy,k=y.findEntryWithLevel(T,w.level),A=y.getMaxDepth(w),M=h._size,S=w.domain,E=M.w*(S.x[1]-S.x[0]),C=M.h*(S.y[1]-S.y[0]),L=.5*Math.min(E,C),P=_.cx=M.l+M.w*(S.x[1]+S.x[0])/2,I=_.cy=M.t+M.h*(1-S.y[0])-C/2;if(!k)return x.remove();var z=null,O={};g&&x.each((function(t){O[y.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!z&&y.isEntry(t)&&(z=t)}));var D=function(t){return a.partition().size([2*Math.PI,t.height+1])(t)}(k).descendants(),R=k.height+1,F=0,B=A;_.hasMultipleRoots&&y.isHierarchyRoot(k)&&(D=D.slice(1),R-=1,F=1,B+=1),D=D.filter((function(t){return t.y1<=B}));var N=Math.min(R,A),j=function(t){return(t-F)/N*L},V=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},U=function(t){return o.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,P,I)},q=function(t){return P+b(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},H=function(t){return I+b(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(x=x.data(D,y.getPtId)).enter().append("g").classed("slice",!0),g?x.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=y.getPtId(t),a=O[r],i=O[y.getPtId(k)];if(i){var o=t.x1>i.x1?2*Math.PI:0;e=t.rpx1G?2*Math.PI:0;e={x0:i,x1:i}}else e={rpx0:L,rpx1:L},o.extendFlat(e,Z(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,a)}(t);return function(t){return U(e(t))}})):u.attr("d",U),l.call(m,k,t,e,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(y.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),u.call(d,a,w);var x=o.ensureSingle(l,"g","slicetext"),b=o.ensureSingle(x,"text","",(function(t){t.attr("data-notex",1)})),T=o.ensureUniformFontSize(t,y.determineTextFont(w,a,h.font));b.text(r.formatSliceLabel(a,k,w,e,h)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(s.convertToTspans,t);var A=i.bBox(b.node());a.transform=p(A,a,_),a.transform.targetX=q(a),a.transform.targetY=H(a);var M=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,c(w.type,r,h),o.getTextTransform(r)};g?b.transition().attrTween("transform",(function(t){var e=function(t){var e,r=O[y.getPtId(t)],a=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:a.textPosAngle,scale:0,rotate:a.rotate,rCenter:a.rCenter,x:a.x,y:a.y}},z)if(t.parent)if(G){var i=t.x1>G?2*Math.PI:0;e.x0=e.x1=i}else o.extendFlat(e,Z(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var s=n.interpolate(e.transform.textPosAngle,t.transform.textPosAngle),l=n.interpolate(e.rpx1,t.rpx1),u=n.interpolate(e.x0,t.x0),f=n.interpolate(e.x1,t.x1),p=n.interpolate(e.transform.scale,a.scale),d=n.interpolate(e.transform.rotate,a.rotate),g=0===a.rCenter?3:0===e.transform.rCenter?1/3:1,m=n.interpolate(e.transform.rCenter,a.rCenter);return function(t){var e=l(t),r=u(t),n=f(t),i=function(t){return m(Math.pow(t,g))}(t),o={pxmid:V(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:i,x:a.x,y:a.y}};return c(w.type,a,h),{transform:{targetX:q(o),targetY:H(o),scale:p(t),rotate:d(t),rCenter:i}}}}(t);return function(t){return M(e(t),A)}})):b.attr("transform",M(a,A))}))}function b(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,a){var i,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,h=!s.uniformtext.mode&&y.hasTransition(r);(u("sunburst",s),(i=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),i.order(),h)?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){x(t,e,this,r)}))}))):(i.each((function(e){x(t,e,this,r)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&i.exit().remove()},r.formatSliceLabel=function(t,e,r,n,a){var i=r.texttemplate,s=r.textinfo;if(!(i||s&&"none"!==s))return"";var l=a.separators,c=n[0],u=t.data.data,h=c.hierarchy,f=y.isHierarchyRoot(t),p=y.getParent(h,t),d=y.getValue(t);if(!i){var g,m=s.split("+"),v=function(t){return-1!==m.indexOf(t)},x=[];if(v("label")&&u.label&&x.push(u.label),u.hasOwnProperty("v")&&v("value")&&x.push(y.formatValue(u.v,l)),!f){v("current path")&&x.push(y.getPath(t.data));var b=0;v("percent parent")&&b++,v("percent entry")&&b++,v("percent root")&&b++;var _=b>1;if(b){var w,T=function(t){g=y.formatPercent(w,l),_&&(g+=" of "+t),x.push(g)};v("percent parent")&&!f&&(w=d/y.getValue(p),T("parent")),v("percent entry")&&(w=d/y.getValue(e),T("entry")),v("percent root")&&(w=d/y.getValue(h),T("root"))}}return v("text")&&(g=o.castOption(r,u.i,"text"),o.isValidTextValue(g)&&x.push(g)),x.join("
")}var k=o.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=y.formatValue(u.v,l)),A.currentPath=y.getPath(t.data),f||(A.percentParent=d/y.getValue(p),A.percentParentLabel=y.formatPercent(A.percentParent,l),A.parent=y.getPtLabel(p)),A.percentEntry=d/y.getValue(e),A.percentEntryLabel=y.formatPercent(A.percentEntry,l),A.entry=y.getPtLabel(e),A.percentRoot=d/y.getValue(h),A.percentRootLabel=y.formatPercent(A.percentRoot,l),A.root=y.getPtLabel(h),u.hasOwnProperty("color")&&(A.color=u.color);var M=o.castOption(r,u.i,"text");return(o.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=o.castOption(r,u.i,"customdata"),o.texttemplateString(k,A,a._d3locale,A,r._meta||{})}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../bar/style":890,"../bar/uniform_text":892,"../pie/plot":1123,"./constants":1254,"./fx":1256,"./helpers":1257,"./style":1262,d3:165,"d3-hierarchy":159}],1262:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":602,"../../lib":735,"../bar/uniform_text":892,d3:165}],1263:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function c(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},a("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},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}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})},hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/color":602,"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plot_api/edit_types":766,"../../plots/attributes":780,"../../plots/template_attributes":861}],1264:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":610}],1265:[function(t,e,r){"use strict";var n=t("gl-surface3d"),a=t("ndarray"),i=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,c=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,h=t("../heatmap/interp2d"),f=t("../heatmap/find_empties");function p(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var d=p.prototype;d.getXat=function(t,e,r,n){var a=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?a:n.d2l(a,0,r)},d.getYat=function(t,e,r,n){var a=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?a:n.d2l(a,0,r)},d.getZat=function(t,e,r,n){var a=this.data.z[e][t];return null===a&&this.data.connectgaps&&this.data._interpolatedZ&&(a=this.data._interpolatedZ[e][t]),void 0===r?a:n.d2l(a,0,r)},d.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),a=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,a],t.traceCoordinate=[this.getXat(n,a),this.getYat(n,a),this.getZat(n,a)],t.dataCoordinate=[this.getXat(n,a,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,a,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,a,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var i=0;i<3;i++){var o=t.dataCoordinate[i];null!=o&&(t.dataCoordinate[i]*=this.scene.dataScale[i])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[a]&&void 0!==s[a][n]?t.textLabel=s[a][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var g=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=g[n];break}return r}function x(t,e){if(!(t<1||e<1)){for(var r=v(t),n=v(e),a=1,i=0;iw;)r--,r/=y(r),++r<_&&(r=w);var n=Math.round(r/t);return n>1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),c=1+n+1,u=1+o+1,h=a(new Float32Array(c*u),[c,u]),f=0;f0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,e=this.contourStart[t];ei&&(this.minValues[e]=i),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1272:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/extend").extendFlat,i=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[a]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},a+=i,s=c+1,i=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var g=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),m=e.domain,v=Math.floor(t._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(t._fullLayout._size.h*(m.y[1]-m.y[0])),x=e.header.values.length?g[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=f(b,y-_+n.uplift),T=h(f(x,_),[]),k=h(w,T),A={},M=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=g.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var C=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:m.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-m.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:C,height:y,columnOrder:M,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:a({},e.cells,{values:r}),headerCells:a({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=u(t)})),L}},{"../../lib/extend":726,"./constants":1271,"fast-isnumeric":237}],1273:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":726}],1274:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,a=r.slice(0,n),i=a.slice().sort((function(t,e){return t-e})),o=a.map((function(t){return i.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var h,f,p=u?"":_(t.calcdata.cells.prefix,e,r)||"",d=u?"":_(t.calcdata.cells.suffix,e,r)||"",g=u?null:_(t.calcdata.cells.format,e,r)||null,m=p+(g?a.format(g)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=b(m)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?b(m):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?m.replace(/a&&n.push(i),a+=l}return n}(a,l,s);1===c.length&&(c[0]===a.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){return"translate(0 "+(z(t.rowBlocks,t.page)-t.scrollY)+")"})),t&&(E(t,r,e,c,n.prevPages,n,0),E(t,r,e,c,n.prevPages,n,1),v(r,t))}}function S(t,e,r,i){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===i?s.scrollY+c*a.event.dy:i;var h=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(T);return M(t,h,l),s.scrollY===u}}function E(t,e,r,n,a,i,o){n[o]!==a[o]&&(clearTimeout(i.currentRepaint[o]),i.currentRepaint[o]=setTimeout((function(){var i=r.filter((function(t,e){return e===o&&n[e]!==a[e]}));y(t,e,i,r),a[o]=n[o]})))}function C(t,e,r,i){return function(){var o=a.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,a,i=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(a=(r=s.shift()).width+i)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=a;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),x(o.select("."+n.cn.cellText),r,t,i),a.select(e.parentNode.parentNode).call(I)}}function L(t,e,r,i,o){return function(){if(!o.settledY){var s=a.select(e.parentNode),l=R(o),c=o.key-l.firstRowIndex,u=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:u,f=Math.max(h,u);f-l.rows[c].rowHeight&&(l.rows[c].rowHeight=f,t.selectAll("."+n.cn.columnCell).call(I),M(null,t.filter(T),0),v(r,i,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=a.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),i=e.top-t.top+(r?r.matrix.f:n.cellPad);return"translate("+P(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+i+")"})),o.settledY=!0}}}function P(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function I(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+O(e,1/0)}),0);return"translate(0 "+(O(R(t),t.key)+e)+")"})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function z(t,e){for(var r=0,n=e-1;n>=0;n--)r+=D(t[n]);return r}function O(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:a({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":609,"../../lib/extend":726,"../../plots/domain":810,"../../plots/template_attributes":861,"../pie/attributes":1114,"../sunburst/attributes":1251,"./constants":1280}],1278:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":846}],1279:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1253}],1280:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1281:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,r,c){function f(r,i){return n.coerce(t,e,a,r,i)}var p=f("labels"),d=f("parents");if(p&&p.length&&d&&d.length){var g=f("values");g&&g.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var m=f("text");f("texttemplate"),e.texttemplate||f("textinfo",Array.isArray(m)?"text+label":"label"),f("hovertext"),f("hovertemplate");var v=f("pathbar.visible");s(t,e,c,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var y=-1!==e.textposition.indexOf("bottom");f("marker.line.width")&&f("marker.line.color",c.paper_bgcolor);var x=f("marker.colors"),b=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;b?h(t,e,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(x||[]).length);var _=2*e.textfont.size;f("marker.pad.t",y?_/4:_),f("marker.pad.l",_/4),f("marker.pad.r",_/4),f("marker.pad.b",y?_:_/4),b&&h(t,e,c,f,{prefix:"marker.",cLetter:"c"}),e._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},v&&(f("pathbar.thickness",e.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),o(e,c,f),e._length=null}else e.visible=!1}},{"../../components/color":602,"../../components/colorscale":614,"../../lib":735,"../../plots/domain":810,"../bar/constants":878,"../bar/defaults":880,"./attributes":1277}],1282:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx");e.exports=function(t,e,r,f,p){var d=p.barDifY,g=p.width,m=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,A=p.makeUpdateTextInterpolator,M={},S=t._fullLayout,E=e[0],C=E.trace,L=E.hierarchy,P=g/C._entryDepth,I=u.listPath(r.data,"id"),z=s(L.copy(),[g,m],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+m,t.onPathbar=!0,!0)}))).reverse(),(f=f.data(z,u.getPtId)).enter().append("g").classed("pathbar",!0),T(f,!0,M,[g,m],x),f.order();var O=f;w&&(O=O.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),O.each((function(s){s._hoverX=v(s.x1-Math.min(g,m)/2),s._hoverY=y(s.y1-m/2);var f=n.select(this),p=a.ensureSingle(f,"path","surface",(function(t){t.style("pointer-events","all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,M,[g,m]);return function(t){return x(e(t))}})):p.attr("d",x),f.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,C,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=a.ensureSingle(f,"g","slicetext"),T=a.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=a.ensureUniformFontSize(t,u.determineTextFont(C,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,E).call(o.convertToTspans,t),s.textBB=i.bBox(T.node()),s.transform=b(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?T.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[g,m]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../sunburst/fx":1256,"../sunburst/helpers":1257,"./constants":1280,"./partition":1287,"./style":1289,d3:165}],1283:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx"),f=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var g=d.width,m=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._fullLayout,E=e[0].trace,C=-1!==E.textposition.indexOf("left"),L=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),I=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,z=s(r,[g,m],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),O=1/0,D=-1/0;z.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),D=Math.max(D,e))})),p=p.data(z,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-O+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[g,m],x),p.order();var R=null;if(w&&M){var F=u.getPtId(M);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:g,y0:0,y1:m}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){var p=u.isHeader(s,E);s._hoverX=v(s.x1-E.marker.pad.r),s._hoverY=y(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),T=a.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[g,m]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?I?"":u.getPtLabel(s)||"":f(s,r,E,e,S)||"";var M=a.ensureSingle(d,"g","slicetext"),z=a.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),O=a.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",L?"end":C||p?"start":"middle").call(i.font,O).call(o.convertToTspans,t),s.textBB=i.bBox(z.node()),s.transform=b(s,{fontSize:O.size,isHeader:p}),s.transform.fontSize=O.size,w?z.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[g,m]);return function(t){return _(e(t))}})):z.attr("transform",_(s))})),R}},{"../../components/drawing":624,"../../lib":735,"../../lib/svg_text_utils":759,"../sunburst/fx":1256,"../sunburst/helpers":1257,"../sunburst/plot":1261,"./constants":1280,"./partition":1287,"./style":1289,d3:165}],1284:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"treemap",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1158,"./attributes":1277,"./base_plot":1278,"./calc":1279,"./defaults":1281,"./layout_attributes":1285,"./layout_defaults":1286,"./plot":1288,"./style":1289}],1285:[function(t,e,r){"use strict";e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1286:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("treemapcolorway",e.colorway),r("extendtreemapcolors")}},{"../../lib":735,"./layout_attributes":1285}],1287:[function(t,e,r){"use strict";var n=t("d3-hierarchy");e.exports=function(t,e,r){var a,i=r.flipX,o=r.flipY,s="dice-slice"===r.packing,l=r.pad[o?"bottom":"top"],c=r.pad[i?"right":"left"],u=r.pad[i?"left":"right"],h=r.pad[o?"top":"bottom"];s&&(a=c,c=l,l=a,a=u,u=h,h=a);var f=n.treemap().tile(function(t,e){switch(t){case"squarify":return n.treemapSquarify.ratio(e);case"binary":return n.treemapBinary;case"dice":return n.treemapDice;case"slice":return n.treemapSlice;default:return n.treemapSliceDice}}(r.packing,r.squarifyratio)).paddingInner(r.pad.inner).paddingLeft(c).paddingRight(u).paddingTop(l).paddingBottom(h).size(s?[e[1],e[0]]:e)(t);return(s||i||o)&&function t(e,r,n){var a;n.swapXY&&(a=e.x0,e.x0=e.y0,e.y0=a,a=e.x1,e.x1=e.y1,e.y1=a);n.flipX&&(a=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-a);n.flipY&&(a=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-a);var i=e.children;if(i)for(var o=0;o-1?E+P:-(L+P):0,z={x0:C,x1:C,y0:I,y1:I+L},O=function(t,e,r){var n=m.tiling.pad,a=function(t){return t-n<=e.x0},i=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return{x0:a(t.x0-n)?0:i(t.x0-n)?r[0]:t.x0,x1:a(t.x1+n)?0:i(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},D=null,R={},F={},B=null,N=function(t,e){return e?R[g(t)]:F[g(t)]},j=function(t,e,r,n){if(e)return R[g(v)]||z;var a=F[m.level]||r;return function(t){return t.data.depth-y.data.depth=(n-=v.r-o)){var y=(r+n)/2;r=y,n=y}var x;f?a<(x=i-v.b)&&x"===Q?(l.x-=i,c.x-=i,u.x-=i,h.x-=i):"/"===Q?(u.x-=i,h.x-=i,o.x-=i/2,s.x-=i/2):"\\"===Q?(l.x-=i,c.x-=i,o.x-=i/2,s.x-=i/2):"<"===Q&&(o.x-=i,s.x-=i),K(l),K(h),K(o),K(c),K(u),K(s),"M"+X(l.x,l.y)+"L"+X(c.x,c.y)+"L"+X(s.x,s.y)+"L"+X(u.x,u.y)+"L"+X(h.x,h.y)+"L"+X(o.x,o.y)+"Z"},toMoveInsideSlice:$,makeUpdateSliceInterpolator:et,makeUpdateTextInterpolator:rt,handleSlicesExit:nt,hasTransition:T,strTransform:at}):b.remove()}e.exports=function(t,e,r,i){var o,s,l=t._fullLayout,c=l._treemaplayer,f=!r;(u("treemap",l),(o=c.selectAll("g.trace.treemap").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("treemap",!0),o.order(),!l.uniformtext.mode&&a.hasTransition(r))?(i&&(s=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){s&&s()})).each("interrupt",(function(){s&&s()})).each((function(){c.selectAll("g.trace").each((function(e){m(t,e,this,r)}))}))):(o.each((function(e){m(t,e,this,r)})),l.uniformtext.mode&&h(t,l._treemaplayer.selectAll(".trace"),"treemap"));f&&o.exit().remove()}},{"../../lib":735,"../bar/constants":878,"../bar/plot":887,"../bar/style":890,"../bar/uniform_text":892,"../sunburst/helpers":1257,"./constants":1280,"./draw_ancestors":1282,"./draw_descendants":1283,d3:165}],1289:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,h=u.i,f=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&"rgba(0,0,0,0)"===f)d=0,s="rgba(0,0,0,0)",l=0;else if(s=i.castOption(r,h,"marker.line.color")||a.defaultLine,l=i.castOption(r,h,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var g=r.marker.depthfade;if(g){var m,v=a.combine(a.addOpacity(r._backgroundColor,.75),f);if(!0===g){var y=o.getMaxDepth(r);m=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else m=e.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var x=0;x0){var y,x,b,_,w,T=t.xa,k=t.ya;"h"===f.orientation?(w=e,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var A=h[t.index];if(w>=A.span[0]&&w<=A.span[1]){var M=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,f,w),C=o.getPositionOnKdePath(A,f,S),L=b._offset,P=b._length;M[y+"0"]=C[0],M[y+"1"]=C[1],M[x+"0"]=M[x+"1"]=S,M[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+h[0].t.labels.kde+" "+E.toFixed(3),M.spikeDistance=v[0].spikeDistance;var I=y+"Spike";M[I]=v[0][I],v[0].spikeDistance=void 0,v[0][I]=void 0,M.hovertemplate=!1,m.push(M),(u={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+P),u[y+"2"]=n.constrain(L+C[1],L,L+P),u[x+"1"]=u[x+"2"]=_._offset+S}}d&&(m=m.concat(v))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var z=l.selectAll(".violinline-"+f.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:m:c?(m.push(c),m):m}},{"../../lib":735,"../../plots/cartesian/axes":783,"../box/hover":906,"./helpers":1294}],1296:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../box/defaults":904,"../box/select":911,"../scatter/style":1163,"./attributes":1290,"./calc":1291,"./cross_trace_calc":1292,"./defaults":1293,"./hover":1295,"./layout_attributes":1297,"./layout_defaults":1298,"./plot":1299,"./style":1300}],1297:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":735,"../box/layout_attributes":908}],1298:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,(function(r,i){return n.coerce(t,e,a,r,i)}),"violin")}},{"../../lib":735,"../box/layout_defaults":909,"./layout_attributes":1297}],1299:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,h=e.xaxis,f=e.yaxis;function p(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),i=t[0],s=i.t,c=i.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,g=s.bdPos,m=e[s.valLetter+"axis"],v=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,a,i,o,l,h,f,_=n.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+d,!0),A=v.l2p(k);if(c.width)e=s.maxKDE/g;else{var M=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?M.maxKDE/g*(M.maxCount/t.pts.length):M.maxKDE/g}if(x){for(h=new Array(T),o=0;o")),c.color=function(t,e){var r=t[e.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(h,d),[c]}function w(t){return n(p,t)}}},{"../../components/color":602,"../../constants/delta.js":705,"../../plots/cartesian/axes":783,"../bar/hover":883}],1312:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":796,"../bar/select":888,"./attributes":1305,"./calc":1306,"./cross_trace_calc":1308,"./defaults":1309,"./event_data":1310,"./hover":1311,"./layout_attributes":1313,"./layout_defaults":1314,"./plot":1315,"./style":1316}],1313:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1314:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s0&&(m+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(a.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":602,"../../components/drawing":624,"../../constants/interactions":710,"../bar/style":890,"../bar/uniform_text":892,d3:165}],1317:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),a=t("../lib"),i=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,i){if(i.enabled){for(var o=i.target,l=a.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return h;case"first":return f;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return f(t)>s};case">=":return function(t){return f(t)>=s};case"[]":return function(t){var e=f(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=f(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=f(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=f(t);return es[1]};case"](":return function(t){var e=f(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=f(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(f(t))};case"}{":return function(t){return-1===s.indexOf(f(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),f),x={},b={},_=0;d?(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(m);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(i=0;i