/** * plotly.js (cartesian - minified) v1.58.4 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":233}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":344}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":359}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":379}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":214}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":395}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":413}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":419}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":423}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":431}],11:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./image"),t("./pie"),t("./contour"),t("./scatterternary"),t("./violin")]),e.exports=n},{"./bar":2,"./box":3,"./contour":4,"./core":5,"./heatmap":6,"./histogram":7,"./histogram2d":8,"./histogram2dcontour":9,"./image":10,"./pie":12,"./scatterternary":13,"./violin":14}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":440}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":481}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":489}],15:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),o=n[0],l=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),u=0,f=l>0?o-4:o;for(r=0;r>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===l&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,s[u++]=255&e);1===l&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,l=r-a;ol?l:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,s=o.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var a,i,o=[],l=e;l>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],16:[function(t,e,r){},{}],17:[function(t,e,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function l(){l.init.call(this)}e.exports=l,e.exports.once=function(t,e){return new Promise((function(r,n){function a(){void 0!==i&&t.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==e&&(i=function(r){t.removeListener(e,a),n(r)},t.once("error",i)),t.once(e,a)}))},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?l.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var a,i,o,l;if(c(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),void 0===o)o=i[e]=r,++t._eventsCount;else if("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=u(t))>0&&o.length>a&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,l=s,console&&console.warn&&console.warn(l)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function h(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=a[t];if(void 0===s)return!1;if("function"==typeof s)i(s,this,e);else{var c=s.length,u=v(s,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},l.prototype.listeners=function(t){return h(this,t,!0)},l.prototype.rawListeners=function(t){return h(this,t,!1)},l.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},l.prototype.listenerCount=g,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],18:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return s(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(a)return n?-1:I(t).length;e=(""+e).toLowerCase(),a=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function h(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,l=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,l/=2,s/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var u=-1;for(i=r;il&&(r=l-s),i=r;i>=0;i--){for(var f=!0,d=0;da&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:c>223?3:c>191?2:1;if(a+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=t[a+1]))&&(s=(31&c)<<6|63&i)>127&&(u=s);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(s=(15&c)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:i=t[a+1],o=t[a+2],l=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),l=(r>>>=0)-(e>>>=0),s=Math.min(o,l),c=this.slice(n,a),u=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function z(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,l=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o>>0)-l&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":15,buffer:18,ieee754:56}],19:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,s=t.time,c=t.periods,u=t.days,f=t.shortDays,d=t.months,yt=t.shortMonths,xt=p(c),bt=h(c),_t=p(u),wt=h(u),Tt=p(f),kt=h(f),Mt=p(d),At=h(d),Lt=p(yt),St=h(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return d[t.getMonth()]},c:null,d:I,e:I,f:H,H:R,I:F,j:N,L:B,m:j,M:U,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:V,u:q,U:G,V:Z,w:Y,W:X,x:null,X:null,y:W,Y:Q,Z:J,"%":gt},Ot={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:$,e:$,f:nt,H:K,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:lt,U:st,V:ct,w:ut,W:ft,x:null,X:null,y:dt,Y:pt,Z:ht,"%":gt},Dt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Lt.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Et(t,i,e,r)},d:M,e:M,f:D,H:L,I:L,j:A,L:O,m:k,M:S,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:P,s:E,S:C,u:v,U:m,V:y,w:g,W:x,x:function(t,e,r){return Et(t,o,e,r)},X:function(t,e,r){return Et(t,s,e,r)},y:_,Y:b,Z:w,"%":z};function zt(t,e){return function(r){var n,a,i,o=[],s=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in c||(c.w=1),"Z"in c?(s=(l=n(a(c.y,0,1))).getUTCDay(),l=s>4||0===s?e.utcMonday.ceil(l):e.utcMonday(l),l=e.utcDay.offset(l,7*(c.V-1)),c.y=l.getUTCFullYear(),c.m=l.getUTCMonth(),c.d=l.getUTCDate()+(c.w+6)%7):(s=(l=r(a(c.y,0,1))).getDay(),l=s>4||0===s?e.timeMonday.ceil(l):e.timeMonday(l),l=e.timeDay.offset(l,7*(c.V-1)),c.y=l.getFullYear(),c.m=l.getMonth(),c.d=l.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),s="Z"in c?n(a(c.y,0,1)).getUTCDay():r(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(s+5)%7:c.w+7*c.U-(s+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Et(t,e,r,n){for(var a,i,o=0,s=e.length,c=r.length;o=c)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Dt[a in l?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ct.x=zt(o,Ct),Ct.X=zt(s,Ct),Ct.c=zt(i,Ct),Ot.x=zt(o,Ot),Ot.X=zt(s,Ot),Ot.c=zt(i,Ot),{format:function(t){var e=zt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=Pt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=zt(t+="",Ot);return e.toString=function(){return t},e},utcParse:function(t){var e=Pt(t+="",!0);return e.toString=function(){return t},e}}}var o,l={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=s.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=s.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function L(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function O(t,e,r){var n=s.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function D(t,e,r){var n=s.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function z(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function P(t,e,r){var n=s.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function E(t,e,r){var n=s.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function I(t,e){return f(t.getDate(),e,2)}function R(t,e){return f(t.getHours(),e,2)}function F(t,e){return f(t.getHours()%12||12,e,2)}function N(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function H(t,e){return B(t,e)+"000"}function j(t,e){return f(t.getMonth()+1,e,2)}function U(t,e){return f(t.getMinutes(),e,2)}function V(t,e){return f(t.getSeconds(),e,2)}function q(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Z(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Y(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function W(t,e){return f(t.getFullYear()%100,e,2)}function Q(t,e){return f(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function $(t,e){return f(t.getUTCDate(),e,2)}function K(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function lt(t){var e=t.getUTCDay();return 0===e?7:e}function st(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function dt(t,e){return f(t.getUTCFullYear()%100,e,2)}function pt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function ht(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],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"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":20}],20:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function l(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return l.floor=function(e){return t(e=new Date(+e)),e},l.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},l.round=function(t){var e=l(t),r=l.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(l.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},l.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?l.filter(o?function(e){return o(e)%t==0}:function(e){return l.count(0,e)%t==0}):l:null}),l}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),l=o.range,s=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=s.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=u.range,d=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=d.range;function h(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=h(0),v=h(1),m=h(2),y=h(3),x=h(4),b=h(5),_=h(6),w=g.range,T=v.range,k=m.range,M=y.range,A=x.range,L=b.range,S=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=C.range,D=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));D.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var z=D.range,P=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),E=P.range,I=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=I.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),N=F.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var H=B(0),j=B(1),U=B(2),V=B(3),q=B(4),G=B(5),Z=B(6),Y=H.range,X=j.range,W=U.range,Q=V.range,J=q.range,$=G.range,K=Z.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=d,t.timeDays=p,t.timeFriday=b,t.timeFridays=L,t.timeHour=u,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=s,t.timeMinutes=c,t.timeMonday=v,t.timeMondays=T,t.timeMonth=C,t.timeMonths=O,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=l,t.timeSunday=g,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=m,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=g,t.timeWeeks=w,t.timeYear=D,t.timeYears=z,t.utcDay=F,t.utcDays=N,t.utcFriday=G,t.utcFridays=$,t.utcHour=I,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=P,t.utcMinutes=E,t.utcMonday=j,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Z,t.utcSaturdays=K,t.utcSecond=o,t.utcSeconds=l,t.utcSunday=H,t.utcSundays=Y,t.utcThursday=q,t.utcThursdays=J,t.utcTuesday=U,t.utcTuesdays=W,t.utcWednesday=V,t.utcWednesdays=Q,t.utcWeek=H,t.utcWeeks=Y,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],21:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(t,e){s.call(this,t,e+"")},l.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=x(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new _;++d=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return j(t,Z),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[z(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var Z=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return V(t,this)}}function X(t){return"function"==typeof t?t:function(){return q(t,this)}}Z.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,l=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},Z.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},Z.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Z.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=l[e])&&++e0&&(e=e.slice(0,o));var s=gt.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return s&&(e=s,l=mt),o?r?function(){var t=l(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=Z.append,dt.empty=Z.empty,dt.node=Z.node,dt.call=Z.call,dt.size=Z.size,dt.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Et(t){return t>1?0:t<-1?At:Math.acos(t)}function It(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var Nt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map((function(t){return(t-d.x)/d.k})).map(s.invert)),f&&f.domain(u.range().map((function(t){return(t-d.y)/d.k})).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function D(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,s).on(x,c),i=T(t.mouse(e)),l=bt(e);function s(){n=1,M(t.mouse(e),i),C(r)}function c(){a.on(y,null).on(x,null),l(n),O(r)}ml.call(e),S(r)}function z(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=bt(r);function h(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=p[0];var x=p[1],b=m[0]-x[0],_=m[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=t.touches(r);ml.call(r);for(var d=0,p=f.length;d360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new ne(i(t+120),i(t),i(t-120))}function Zt(e,r,n){return this instanceof Zt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Zt?new Zt(e.h,e.c,e.l):Kt(e instanceof Wt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Zt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Gt(this.h,this.s,this.l)},t.hcl=Zt;var Yt=Zt.prototype=new Ut;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Wt(r,Math.cos(t*=Ot)*e,Math.sin(t)*e)}function Wt(t,e,r){return this instanceof Wt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Wt?new Wt(t.l,t.a,t.b):t instanceof Zt?Xt(t.h,t.c,t.l):ue((t=ne(t)).r,t.g,t.b):new Wt(t,e,r)}Yt.brighter=function(t){return new Zt(this.h,this.c,Math.min(100,this.l+Qt*(arguments.length?t:1)))},Yt.darker=function(t){return new Zt(this.h,this.c,Math.max(0,this.l-Qt*(arguments.length?t:1)))},Yt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Wt;var Qt=18,Jt=Wt.prototype=new Ut;function $t(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ne(re(3.2404542*(a=.95047*te(a))-1.5371385*(n=1*te(n))-.4985314*(i=1.08883*te(i))),re(-.969266*a+1.8760108*n+.041556*i),re(.0556434*a-.2040259*n+1.0572252*i))}function Kt(t,e,r){return t>0?new Zt(Math.atan2(r,e)*Dt,Math.sqrt(e*e+r*r),t):new Zt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):se(""+t,ne,Gt):new ne(t,e,r)}function ae(t){return new ne(t>>16,t>>8&255,255&t)}function ie(t){return ae(t)+""}Jt.brighter=function(t){return new Wt(Math.min(100,this.l+Qt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Wt(Math.max(0,this.l-Qt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return $t(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Ut;function le(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function se(t,e,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(de(a[0]),de(a[1]),de(a[2]))}return(i=pe.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function ce(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e0&&s<1?0:n),new Vt(n,a,s)}function ue(t,e,r){var n=ee((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/.95047),a=ee((.2126729*t+.7151522*e+.072175*r)/1);return Wt(116*a-16,500*(n-a),200*(a-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void l.error.call(o,t)}l.load.call(o,t)}else l.error.call(o,c)}return this.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{l.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,l,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}pe.forEach((function(t,e){pe.set(t,ae(e))})),t.functor=he,t.xhr=ge(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=ve(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(be),be=setTimeout(Te,e)),xe=0):(xe=1,_e(Te))}function ke(){for(var t=Date.now(),e=me;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=me,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Se(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(r-=l,r+l)),!((s+=l+1)>e));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:O;return function(e){var n=Ce.exec(e),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,m="%",h="f";break;case"p":g=100,m="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],m=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Oe.get(h)||De;var b=u&&d;return function(e){var n=m;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+m}else e*=g;var _,w,T=(e=h(e,p)).lastIndexOf(".");if(T<0){var k=x?e.lastIndexOf("e"):-1;k<0?(_=e,w=""):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,T),w=r+e.substring(T+1);!u&&d&&(_=o(_,1/0));var M=v.length+_.length+w.length+(b?0:i.length),A=M"===l?A+i+e:"^"===l?A.substring(0,M>>=1)+i+e+A.substring(M):i+(b?e:A+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Ae(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Oe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Ae(e,r))).toFixed(Math.max(0,Math.min(20,Ae(e*(1+1e-15),r))))}});function De(t){return t+""}var ze=t.time={},Pe=Date;function Ee(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ee.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ie.setUTCDate.apply(this._,arguments)},setDay:function(){Ie.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ie.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ie.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ie.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ie.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ie.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ie.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ie.setTime.apply(this._,arguments)}};var Ie=Date.prototype;function Re(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r1)for(;o=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=w[o in Be?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Pe=Ee);return r._=t,e(r)}finally{Pe=Date}}return r.parse=function(t){try{Pe=Ee;var r=e.parse(t);return r&&r._}finally{Pe=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var d=t.map(),p=Ve(o),h=qe(o),g=Ve(l),v=qe(l),m=Ve(s),y=qe(s),x=Ve(c),b=qe(c);i.forEach((function(t,e){d.set(t.toLowerCase(),e)}));var _={a:function(t){return l[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+ze.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(ze.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(ze.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ar,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:$e,e:$e,H:tr,I:tr,j:Ke,L:nr,m:Je,M:er,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ze,w:Ge,W:Ye,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:We,Y:Xe,Z:Qe,"%":ir};return u}ze.year=Re((function(t){return(t=ze.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),ze.years=ze.year.range,ze.years.utc=ze.year.utc.range,ze.day=Re((function(t){var e=new Pe(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),ze.days=ze.day.range,ze.days.utc=ze.day.utc.range,ze.dayOfYear=function(t){var e=ze.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=ze[t]=Re((function(t){return(t=ze.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));ze[t+"s"]=r.range,ze[t+"s"].utc=r.utc.range,ze[t+"OfYear"]=function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)}})),ze.week=ze.sunday,ze.weeks=ze.sunday.range,ze.weeks.utc=ze.sunday.utc.range,ze.weekOfYear=ze.sundayOfYear;var Be={"-":"",_:" ",0:"0"},He=/^\s*\d+/,je=/^%/;function Ue(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+a[0].length):-1}function Qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function $e(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ue(n,"0",2)+Ue(a,"0",2)}function ir(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r=0?1:-1,l=o*i,s=Math.cos(e),c=Math.sin(e),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Sr.add(Math.atan2(d,f)),r=t,n=s,a=c}Cr.point=function(o,l){Cr.point=i,r=(t=o)*Ot,n=Math.cos(l=(e=l)*Ot/2+At/4),a=Math.sin(l)},Cr.lineEnd=function(){i(t,e)}}function Dr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Er(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ir(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),It(t[2])]}function Nr(t,e){return y(t[0]-e[0])kt?a=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,i){u.push(f=[e=t,n=t]),ia&&(a=i)}function h(t,o){var l=Dr([t*Ot,o*Ot]);if(s){var c=Pr(s,l),u=Pr([c[1],-c[0],0],c);Rr(u),u=Fr(u);var f=t-i,d=f>0?1:-1,h=u[0]*Dt*d,g=y(f)>180;if(g^(d*ia&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&ha&&(a=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);s=l,i=t}function g(){d.point=h}function v(){f[0]=e,f[1]=n,d.point=p,s=null}function m(t,e){if(s){var r=t-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,l=e;Cr.point(t,e),h(t,e)}function x(){Cr.lineStart()}function b(){m(o,l),Cr.lineEnd(),y(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function T(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){mr=yr=xr=br=_r=wr=Tr=kr=Mr=Ar=Lr=0,t.geo.stream(e,Br);var r=Mr,n=Ar,a=Lr,i=r*r+n*n+a*a;return i=0;--l)a.point((f=u[l])[0],f[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function Xr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n=0?1:-1,T=w*_,k=T>At,M=h*x;if(Sr.add(Math.atan2(M*w*Math.sin(T),g*b+M*Math.cos(T))),i+=k?_+w*Lt:_,k^d>=r^m>=r){var A=Pr(Dr(f),Dr(t));Rr(A);var L=Pr(a,A);Rr(L);var S=(k^_>=0?-1:1)*It(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;d=m,h=x,g=b,f=t}}return(i<-kt||i0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i1&&2&e&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Jr))}return u}}function Jr(t){return t.length>1}function $r(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:E,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var tn=Qr(Zr,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?At:-At,s=y(i-r);y(s-At)0?Ct:-Ct),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=At&&(y(r-a)kt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Ct,n.point(-At,a),n.point(0,a),n.point(At,a),n.point(At,0),n.point(At,-a),n.point(0,-a),n.point(-At,-a),n.point(-At,0),n.point(-At,a);else if(y(t[0]-e[0])>kt){var i=t[0]0,n=y(e)>kt;return Qr(a,(function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?At:-At),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=i(e,h),(Nr(e,p)||Nr(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=i(h,e),t.point(p[0],p[1])):(p=i(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var m;v&l||!(m=i(h,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Nr(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}}),Nn(t,6*Ot),r?[0,-t]:[-At,t-At]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Pr(Dr(t),Dr(r)),o=zr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&t;var c=e*o/s,u=-e*l/s,f=Pr(a,i),d=Ir(a,c);Er(d,Ir(i,u));var p=f,h=zr(d,p),g=zr(p,p),v=h*h-g*(zr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Ir(p,(-h-m)/g);if(Er(x,d),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],T=t[1],k=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-At)0^x[1]<(y(x[0]-_)At^(_<=x[0]&&x[0]<=w)){var L=Ir(p,(-h+m)/g);return Er(L,d),[x,Fr(L)]}}}function o(e,n){var a=r?t:At-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function rn(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=t-s,d||!(i>0)){if(i/=d,d<0){if(i0){if(i>f)return;i>u&&(u=i)}if(i=r-s,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>u&&(u=i)}else if(d>0){if(i0)){if(i/=p,p<0){if(i0){if(i>f)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}function nn(e,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=$r(),w=rn(e,r,n,a),T={point:A,lineStart:function(){T.point=L,u&&u.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&m&&_.rejoin(),c.push(_.buffer()));T.point=A,m&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;an&&Pt(c,i,t)>0&&++e:i[1]<=n&&Pt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),k(null,null,1,s),s.lineEnd()),i&&Yr(c,o,r,k,s),s.polygonEnd()),c=u=f=null}};function k(t,o,s,c){var u=0,f=0;if(null==t||(u=i(t,s))!==(f=i(o,s))||l(t,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function A(t,e){M(t,e)&&s.point(t,e)}function L(t,e){var r=M(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(u&&f.push([t,e]),y)d=t,p=e,h=r,y=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&m)s.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,m=r}return T};function i(t,a){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:a>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=At/3,n=On(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,It((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(l){return arguments.length?(i=nn(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var ln,sn,cn,un,fn,dn,pn={point:E,lineStart:E,lineEnd:E,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=E,ln+=y(sn/2)}};function hn(){var t,e,r,n;function a(t,e){sn+=n*t-r*e,r=t,n=e}pn.point=function(i,o){pn.point=a,t=r=i,e=n=o},pn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){tfn&&(fn=t);edn&&(dn=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E};function vn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function l(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=Tn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,Tr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}xn.point=function(n,a){xn.point=r,bn(t=n,e=a)}}function wn(){xn.point=bn}function Tn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,Tr+=o*(n+e)/2,kr+=o,Mr+=(o=n*t-r*e)*(r+t),Ar+=o*(n+e),Lr+=3*o,bn(r=t,n=e)}xn.point=function(i,o){xn.point=a,bn(t=r=i,e=n=o)},xn.lineEnd=function(){a(t,e)}}function kn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:E};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Lt)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function l(){t.closePath()}return r}function Mn(t){var e=.5,r=Math.cos(30*Ot),n=16;function a(t){return(n?o:i)(t)}function i(e){return Sn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,a,i,o,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var i=Dr([r,a]),o=t(r,a);l(f,d,u,p,h,g,f=o[0],d=o[1],u=r,p=i[0],h=i[1],g=i[2],n,e),e.point(f,d)}function b(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=T}function w(t,e){x(r=t,e),a=f,i=d,o=p,s=h,c=g,v.point=x}function T(){l(f,d,u,p,h,g,a,i,r,o,s,c,n,e),v.lineEnd=b,b()}return v}function l(n,a,i,o,s,c,u,f,d,p,h,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=o+p,T=s+h,k=c+g,M=Math.sqrt(w*w+T*T+k*k),A=Math.asin(k/=M),L=y(y(k)-1)e||y((x*D+b*z)/_-.5)>.3||o*p+s*h+c*g0&&16,a):Math.sqrt(e)},a}function An(t){var e=Mn((function(e,r){return t([e*Dt,r*Dt])}));return function(t){return Dn(e(t))}}function Ln(t){this.stream=t}function Sn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Cn(t){return On((function(){return t}))()}function On(e){var r,n,a,i,o,l,s=Mn((function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]})),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=tn,y=O,x=null,b=null;function _(t){return[(t=a(t[0]*Ot,t[1]*Ot))[0]*c+i,o-t[1]*c]}function w(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Dt,t[1]*Dt]}function T(){a=Gr(n=En(h,g,v),r);var t=r(d,p);return i=u-t[0]*c,o=f+t[1]*c,k()}function k(){return l&&(l.valid=!1,l=null),_}return _.stream=function(t){return l&&(l.valid=!1),(l=Dn(m(n,s(y(t))))).valid=!0,l},_.clipAngle=function(t){return arguments.length?(m=null==t?(x=t,tn):en((x=+t)*Ot),k()):x},_.clipExtent=function(t){return arguments.length?(b=t,y=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):O,k()):b},_.scale=function(t){return arguments.length?(c=+t,T()):c},_.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],T()):[u,f]},_.center=function(t){return arguments.length?(d=t[0]%360*Ot,p=t[1]%360*Ot,T()):[d*Dt,p*Dt]},_.rotate=function(t){return arguments.length?(h=t[0]%360*Ot,g=t[1]%360*Ot,v=t.length>2?t[2]%360*Ot:0,T()):[h*Dt,g*Dt,v*Dt]},t.rebind(_,s,"precision"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,T()}}function Dn(t){return Sn(t,(function(e,r){t.point(e*Ot,r*Ot)}))}function zn(t,e){return[t,e]}function Pn(t,e){return[t>At?t-Lt:t<-At?t+Lt:t,e]}function En(t,e,r){return t?e||r?Gr(Rn(t),Fn(e,r)):Rn(t):e||r?Fn(e,r):Pn}function In(t){return function(e,r){return[(e+=t)>At?e-Lt:e<-At?e+Lt:e,r]}}function Rn(t){var e=In(t);return e.invert=In(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),It(u*a+s*i)]}return o.invert=function(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),It(u*r-l*n)]},o}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=Bn(r,a),i=Bn(r,i),(o>0?ai)&&(a+=o*Lt)):(a=t+o*Lt,i=t-.5*s);for(var c,u=a;o>0?u>i:u2?t[2]*Ot:0),e.invert=function(e){return(e=t.invert(e[0]*Ot,e[1]*Ot))[0]*=Dt,e[1]*=Dt,e},e},Pn.invert=zn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=En(-t[0]*Ot,-t[1]*Ot,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Dt,t[1]*=Dt}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=Nn((t=+r)*Ot,n*Ot),a):t},a.precision=function(r){return arguments.length?(e=Nn(t*Ot,(n=+r)*Ot),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ot,a=t[1]*Ot,i=e[1]*Ot,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},t.geo.graticule=function(){var e,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(r/p)*p,e,p).filter((function(t){return y(t%g)>kt})).map(c)).concat(t.range(Math.ceil(o/h)*h,i,h).filter((function(t){return y(t%v)>kt})).map(u))}return x.lines=function(){return b().map((function(t){return{type:"LineString",coordinates:t}}))},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],s=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),s>l&&(t=s,s=l,l=t),x.precision(m)):[[a,s],[n,l]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(m)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(m=+t,c=Hn(o,i,90),u=jn(r,e,m),f=Hn(s,l,90),d=jn(a,n,m),x):m},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Un,a=Vn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Ot,n=t[1]*Ot,a=e[0]*Ot,i=e[1]*Ot,o=Math.cos(n),l=Math.sin(n),s=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),f=o*Math.sin(r),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(Ft(i-n)+o*s*Ft(a-r))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,r=Math.sin(h-t)*g,n=r*u+e*d,a=r*f+e*p,i=r*l+e*c;return[Math.atan2(a,n)*Dt,Math.atan2(i,Math.sqrt(n*n+a*a))*Dt]}:function(){return[r*Dt,n*Dt]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return yn=0,t.geo.stream(e,qn),yn};var qn={sphere:E,point:E,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Ot),o=Math.cos(a),l=y((n*=Ot)-t),s=Math.cos(l);yn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-e*o*s)*l),e*i+r*o*s),t=n,e=i,r=o}qn.point=function(a,i){t=a*Ot,e=Math.sin(i*=Ot),r=Math.cos(i),qn.point=n},qn.lineEnd=function(){qn.point=qn.lineEnd=E}},lineEnd:E,polygonStart:E,polygonEnd:E};function Gn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Zn=Gn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Cn(Zn)}).raw=Zn;var Yn=Gn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),O);function Xn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Jn;function o(t,e){i>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=zt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ct]},o}function Wn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)1&&Pt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Cn(ta)}).raw=ta,ea.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=$n(ea),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ea,t.geom={},t.geom.hull=function(t){var e=ra,r=na;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=he(e),i=he(r),o=t.length,l=[],s=[];for(n=0;n=0;--n)p.push(t[l[c[n]][2]]);for(n=+f;nkt)l=l.L;else{if(!((a=i-Ta(l,o))>kt)){n>-kt?(e=l.P,r=l):a>-kt?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=ya(t);if(da.insert(e,s),e||r){if(e===r)return Sa(e),r=ya(e.site),da.insert(s,r),s.edge=r.edge=Da(e.site,s.site),La(e),void La(r);if(r){Sa(e),Sa(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,x=g*g+v*v,b={x:(v*y-p*x)/m+u,y:(d*x-g*y)/m+f};Pa(r.edge,c,h,b),s.edge=Da(c,t,null,b),r.edge=Da(t,h,null,b),La(e),La(r)}else s.edge=Da(e.site,s.site)}}function wa(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function Ta(t,e){var r=t.N;if(r)return wa(r,e);var n=t.site;return n.y===e?n.x:1/0}function ka(t){this.site=t,this.edges=[]}function Ma(t,e){return e.angle-t.angle}function Aa(){Ra(this),this.x=this.y=this.arc=this.site=this.cy=null}function La(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Mt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,m=va.pop()||new Aa;m.arc=t,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,t.circle=m;for(var y=null,x=ha._;x;)if(m.y=l)return;if(d>h){if(i){if(i.y>=c)return}else i={x:v,y:s};r={x:v,y:c}}else{if(i){if(i.y1)if(d>h){if(i){if(i.y>=c)return}else i={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(i){if(i.y=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.xkt||y(a-r)>kt)&&(l.splice(o,0,new Ea(za(i.site,u,y(n-f)kt?{x:f,y:y(e-f)kt?{x:y(r-h)kt?{x:d,y:y(e-d)kt?{x:y(r-p)=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[l]})),e}function l(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return Ha(l(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return Ha(l(t)).cells.forEach((function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ma),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++ui||f>o||d=_)<<1|e>=b,T=w+4;wi&&(a=e.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Wa(r,n)})),i=$a.lastIndex;return ig&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;fg&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,T=v-h;function k(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(y(s-r)+y(c-n)<.01)M(t,e,r,n,a,i,o,l);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,s,c,a,i,o,l),M(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,l)}function M(t,e,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;t.leaf=!1,u?a=s:o=s,f?i=c:l=c,k(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,l)}w>T?v=h+w:g=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+m(t,++f),+x(t,f),p,h,g,v)},visit:function(t){Ga(t,A,p,h,g,v)},find:function(t){return Za(A,t[0],t[1],p,h,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function ti(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function ii(t){return function(e){return 1-t(1-e)}}function oi(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function li(t){return t*t}function si(t){return t*t*t}function ci(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ui(t){return 1-Math.cos(t*Ct)}function fi(t){return Math.pow(2,10*(t-1))}function di(t){return 1-Math.sqrt(1-t*t)}function pi(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function hi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function gi(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=mi(a),l=vi(a,i),s=mi(((e=i)[0]+=(n=-l)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=ri.get(n)||ei,ai((a=ni.get(a)||O)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,l=r.c-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,l=r.s-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Gt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(t){return $t(n+o*t,a+l*t,i+s*t)+""}},t.interpolateRound=hi,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new gi(e?e.matrix:yi)})(e)},gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yi={a:1,b:0,c:0,d:1,e:0,f:0};function xi(t){return t.length?t.pop()+",":""}function bi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Wa(t[0],e[0])},{i:a-2,x:Wa(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(xi(r)+"rotate(",null,")")-2,x:Wa(t,e)})):e&&r.push(xi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(xi(r)+"skewX(",null,")")-2,x:Wa(t,e)}):e&&r.push(xi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(xi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Wa(t[0],e[0])},{i:a-2,x:Wa(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(xi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:n=0})):t>0&&(s.start({type:"start",alpha:n=t}),e=we(l.tick)),l):n},l.start=function(){var t,e,r,n=m.length,s=y.length,u=c[0],h=c[1];for(t=0;t=0;)r.push(a[n])}function Ei(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(u=c[s]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Ei(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),l}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Pi(t,(function(t){t.children&&(t.value=0)})),Ei(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=e.value?n/e.value:0;++cl&&(l=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function Xi(t){return t.reduce(Wi,0)}function Wi(t,e){return t+e[1]}function Qi(t,e){return Ji(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ji(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function $i(e){return[t.min(e),t.max(e)]}function Ki(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function no(t){if((e=t.children)&&(s=e.length)){var e,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(ao),(r=e[0]).x=-r.r,r.y=0,x(r),s>1&&((n=e[1]).x=n.r,n.y=0,x(n),s>2))for(oo(r,n,a=e[2]),x(a),to(r,a),r._pack_prev=a,to(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=he(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Ji(e,t)}:he(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ki),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,Ei(l,(function(t){t.r=+u(t.value)})),Ei(l,no),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;Ei(l,(function(t){t.r+=f})),Ei(l,no),Ei(l,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,l=i.length;++op.x&&(p=t),t.depth>h.depth&&(h=t)}));var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Pi(u,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,l=e,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=co(l),i=so(i),l&&i;)s=so(s),(o=co(o)).a=t,(a=l.z+f-i.z-c+r(l._,i._))>0&&(uo(fo(l,t,n),t,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!co(o)&&(o.t=l,o.m+=f-u),i&&!so(s)&&(s.t=i,s.m+=c-d,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?s:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:s,i):a?n:null},zi(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=lo,n=[1,1],a=!1;function i(i,o){var l,s=e.call(this,i,o),c=s[0],u=0;Ei(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=l?u+=r(e,l):0,e.y=0,l=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Ei(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(h-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),s}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},zi(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=po,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function h(t,e,r,a){var i,o=-1,l=t.length,s=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?_o:mo,l=a?wi:_i;return i=t(e,r,l,n),o=t(r,e,l,Ka),s}function s(t){return i(t)}return s.invert=function(t){return o(t)},s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e},s.range=function(t){return arguments.length?(r=t,l()):r},s.rangeRound=function(t){return s.range(t).interpolate(hi)},s.clamp=function(t){return arguments.length?(a=t,l()):a},s.interpolate=function(t){return arguments.length?(n=t,l()):n},s.ticks=function(t){return Mo(e,t)},s.tickFormat=function(t,r){return Ao(e,t,r)},s.nice=function(t){return To(e,t),l()},s.copy=function(){return t(e,r,n,a)},l()}([0,1],[0,1],Ka,!1)};var Lo={s:1,g:1,p:1,r:1,e:1};function So(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function l(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return r(o(t))}return s.invert=function(t){return l(r.invert(t))},s.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),s):i},s.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),s):n},s.nice=function(){var t=yo(i.map(o),a?Math:Oo);return r.domain(t),i=t.map(l),s},s.ticks=function(){var t=go(i),e=[],r=t[0],s=t[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c0;d--)e.push(l(c)*d);for(c=0;e[c]s;u--);e=e.slice(c,u)}return e},s.tickFormat=function(e,r){if(!arguments.length)return Co;arguments.length<2?r=Co:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/s.ticks().length);return function(t){var e=t/l(Math.round(o(t)));return e*n0?a[t-1]:r[0],tf?0:1;if(c=St)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,T,k,M,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Fo?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=It(v/c*Math.sin(m))),l&&(A=It(v/l*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var C=Math.abs(f-u-2*L)<=At?0:1;if(L&&Vo(y,x,b,_)===p^C){var O=(u+f)/2;y=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else y=x=0;if(l){w=l*Math.cos(f-A),T=l*Math.sin(f-A),k=l*Math.cos(u+A),M=l*Math.sin(u+A);var D=Math.abs(u-f+2*A)<=At?0:1;if(A&&Vo(w,T,k,M)===1-p^D){var z=(u+f)/2;w=l*Math.cos(z),T=l*Math.sin(z),k=M=null}}else w=T=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l0?0:1}function qo(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,x=r-n,b=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,T=(-b*v-m*_)/y,k=(b*m+v*_)/y,M=(-b*v+m*_)/y,A=w-h,L=T-g,S=k-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=k,T=M),[[w-s,T-c],[w*r/x,T*r/x]]}function Go(t){var e=ra,r=na,n=Zr,a=Yo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=he(e),p=he(r);function h(){s.push("M",a(t(c),o))}for(;++u1&&a.push("H",n[0]);return a.join("")},"step-before":Wo,"step-after":Qo,basis:Ko,"basis-open":function(t){if(t.length<4)return Yo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(tl(nl,i)+","+tl(nl,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(t))}});function Yo(t){return t.length>1?t.join("L"):t+"Z"}function Xo(t){return t.join("L")+"Z"}function Wo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){l=e[1],i=t[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;cAt)+",1 "+e}function s(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=he(t),i):r},i.source=function(e){return arguments.length?(t=he(e),i):t},i.target=function(t){return arguments.length?(e=he(t),i):e},i.startAngle=function(t){return arguments.length?(n=he(t),i):n},i.endAngle=function(t){return arguments.length?(a=he(t),i):a},i},t.svg.diagonal=function(){var t=Un,e=Vn,r=cl;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(e){return arguments.length?(t=he(e),n):t},n.target=function(t){return arguments.length?(e=he(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=cl,n=e.projection;return e.projection=function(t){return arguments.length?n(ul(r=t)):r},e},t.svg.symbol=function(){var t=dl,e=fl;function r(r,n){return(hl.get(t.call(this,r,n))||pl)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=he(e),r):t},r.size=function(t){return arguments.length?(e=he(t),r):e},r};var hl=t.map({circle:pl,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*vl)),r=e*vl;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/gl),r=e*gl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/gl),r=e*gl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=hl.keys();var gl=Math.sqrt(3),vl=Math.tan(30*Ot);Z.transition=function(t){for(var e,r,n=bl||++Tl,a=Al(t),i=[],o=_l||{time:Date.now(),ease:ci,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=we((function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}wl.call=Z.call,wl.empty=Z.empty,wl.node=Z.node,wl.size=Z.size,t.transition=function(e,r){return e&&e.transition?bl?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=wl,wl.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,T=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),M=bt(m),A=t.mouse(m),L=t.select(o(m)).on("keydown.brush",O).on("keyup.brush",D);if(t.event.changedTouches?L.on("touchmove.brush",z).on("touchend.brush",E):L.on("mousemove.brush",z).on("mouseup.brush",E),b.interrupt().selectAll("*").interrupt(),k)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-A[0],s[1-C]-A[1]],A[0]=l[S],A[1]=s[C]}else t.event.altKey&&(f=A.slice());function O(){32==t.event.keyCode&&(k||(f=null,A[0]-=l[1],A[1]-=s[1],k=2),F())}function D(){32==t.event.keyCode&&2==k&&(A[0]+=l[1],A[1]+=s[1],k=0,F())}function z(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),k||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]1?{floor:function(e){for(;l(e=t.floor(e));)e=Bl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Bl(+e+1);return e}}:t))},a.ticks=function(t,e){var r=go(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Bl(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Nl(e.copy(),r,n)},wo(a,e)}function Bl(t){return new Date(t)}El.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fl:Rl,Fl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fl.toString=Rl.toString,ze.second=Re((function(t){return new Pe(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),ze.seconds=ze.second.range,ze.seconds.utc=ze.second.utc.range,ze.minute=Re((function(t){return new Pe(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),ze.minutes=ze.minute.range,ze.minutes.utc=ze.minute.utc.range,ze.hour=Re((function(t){var e=t.getTimezoneOffset()/60;return new Pe(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),ze.hours=ze.hour.range,ze.hours.utc=ze.hour.utc.range,ze.month=Re((function(t){return(t=ze.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),ze.months=ze.month.range,ze.months.utc=ze.month.utc.range;var Hl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],jl=[[ze.second,1],[ze.second,5],[ze.second,15],[ze.second,30],[ze.minute,1],[ze.minute,5],[ze.minute,15],[ze.minute,30],[ze.hour,1],[ze.hour,3],[ze.hour,6],[ze.hour,12],[ze.day,1],[ze.day,2],[ze.week,1],[ze.month,1],[ze.month,3],[ze.year,1]],Ul=El.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Zr]]),Vl={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Bl)},floor:O,ceil:O};jl.year=ze.year,ze.scale=function(){return Nl(t.scale.linear(),jl,Ul)};var ql=jl.map((function(t){return[t[0].utc,t[1]]})),Gl=Il.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Zr]]);function Zl(t){return JSON.parse(t.responseText)}function Yl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}ql.year=ze.year.utc,ze.scale.utc=function(){return Nl(t.scale.linear(),ql,Gl)},t.text=ge((function(t){return t.responseText})),t.json=function(t,e){return ve(t,"application/json",Zl,e)},t.html=function(t,e){return ve(t,"text/html",Yl,e)},t.xml=ge((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],22:[function(t,e,r){(function(n,a){(function(){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ !function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,l=void 0,s=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t>1,u=-7,f=r?a-1:0,d=r?-1:1,p=t[e+f];for(f+=d,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=d,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=d,u-=8);if(0===i)i=1-c;else{if(i===s)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),i-=c}return(p?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,l,s,c=8*i-a-1,u=(1<>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(o++,s/=2),o+f>=u?(l=0,o=u):o+f>=1?(l=(e*s-1)*Math.pow(2,a),o+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+p]=255&l,p+=h,l/=256,a-=8);for(o=o<0;t[r+p]=255&o,p+=h,o/=256,c-=8);t[r+p-h]|=128*g}},{}],57:[function(t,e,r){"use strict";var n=t("./types");e.exports=function(t,e){var r;for(r in n)if(n[r].detect(t,e))return r}},{"./types":60}],58:[function(t,e,r){(function(r){(function(){"use strict";var n=t("fs"),a=t("path"),i=t("./types"),o=t("./detector");function l(t,e){var r=o(t,e);if(r in i){var n=i[r].calculate(t,e);if(!1!==n)return n.type=r,n}throw new TypeError("unsupported file type: "+r+" (file: "+e+")")}e.exports=function(t,e){if(r.isBuffer(t))return l(t);if("string"!=typeof t)throw new TypeError("invalid invocation");var i=a.resolve(t);if("function"!=typeof e)return l(function(t){var e=n.openSync(t,"r"),a=n.fstatSync(e).size,i=Math.min(a,524288),o=r.alloc(i);return n.readSync(e,o,0,i,0),n.closeSync(e),o}(i),i);!function(t,e){n.open(t,"r",(function(a,i){if(a)return e(a);n.fstat(i,(function(a,o){if(a)return e(a);var l=o.size;if(l<=0)return e(new Error("File size is not greater than 0 \u2014\u2014 "+t));var s=Math.min(l,524288),c=r.alloc(s);n.read(i,c,0,s,0,(function(t){if(t)return e(t);n.close(i,(function(t){e(t,c)}))}))}))}))}(i,(function(t,r){if(t)return e(t);var n;try{n=l(r,i)}catch(e){t=e}e(t,n)}))},e.exports.types=Object.keys(i)}).call(this)}).call(this,t("buffer").Buffer)},{"./detector":57,"./types":60,buffer:18,fs:16,path:78}],59:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r=r||0,t["readUInt"+e+(n?"BE":"LE")].call(t,r)}},{}],60:[function(t,e,r){"use strict";var n={bmp:t("./types/bmp"),cur:t("./types/cur"),dds:t("./types/dds"),gif:t("./types/gif"),icns:t("./types/icns"),ico:t("./types/ico"),jpg:t("./types/jpg"),png:t("./types/png"),psd:t("./types/psd"),svg:t("./types/svg"),tiff:t("./types/tiff"),webp:t("./types/webp")};e.exports=n},{"./types/bmp":61,"./types/cur":62,"./types/dds":63,"./types/gif":64,"./types/icns":65,"./types/ico":66,"./types/jpg":67,"./types/png":68,"./types/psd":69,"./types/svg":70,"./types/tiff":71,"./types/webp":72}],61:[function(t,e,r){"use strict";e.exports={detect:function(t){return"BM"===t.toString("ascii",0,2)},calculate:function(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}}},{}],62:[function(t,e,r){"use strict";e.exports={detect:function(t){return 0===t.readUInt16LE(0)&&2===t.readUInt16LE(2)},calculate:t("./ico").calculate}},{"./ico":66}],63:[function(t,e,r){"use strict";e.exports={detect:function(t){return 542327876===t.readUInt32LE(0)},calculate:function(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}}},{}],64:[function(t,e,r){"use strict";var n=/^GIF8[79]a/;e.exports={detect:function(t){var e=t.toString("ascii",0,6);return n.test(e)},calculate:function(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}}},{}],65:[function(t,e,r){"use strict";var n={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function a(t,e){var r=e+4;return[t.toString("ascii",e,r),t.readUInt32BE(r)]}function i(t){var e=n[t];return{width:e,height:e,type:t}}e.exports={detect:function(t){return"icns"===t.toString("ascii",0,4)},calculate:function(t){var e,r,n,o=t.length,l=8,s=t.readUInt32BE(4);if(r=i((e=a(t,l))[0]),(l+=e[1])===s)return r;for(n={width:r.width,height:r.height,images:[r]};lt.length)return;var l=t.slice(r,a);if(274===n(l,16,0,e)){if(3!==n(l,16,2,e))return;if(1!==n(l,32,4,e))return;return n(l,16,8,e)}}}(r,i)}function l(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==t[e])throw new TypeError("Invalid JPG, marker table corrupted")}e.exports={detect:function(t){return"ffd8"===t.toString("hex",0,2)},calculate:function(t){var e,r,n;for(t=t.slice(4);t.length;){if(r=t.readUInt16BE(0),a(t)&&(e=o(t,r)),l(t,r),192===(n=t[r+1])||193===n||194===n){var s=i(t,r+5);return e?{width:s.width,height:s.height,orientation:e}:s}t=t.slice(r+2)}throw new TypeError("Invalid JPG, no size found")}}},{"../readUInt":59}],68:[function(t,e,r){"use strict";e.exports={detect:function(t){if("PNG\r\n\x1a\n"===t.toString("ascii",1,8)){var e=t.toString("ascii",12,16);if("CgBI"===e&&(e=t.toString("ascii",28,32)),"IHDR"!==e)throw new TypeError("invalid png");return!0}},calculate:function(t){return"CgBI"===t.toString("ascii",12,16)?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}}},{}],69:[function(t,e,r){"use strict";e.exports={detect:function(t){return"8BPS"===t.toString("ascii",0,4)},calculate:function(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}}},{}],70:[function(t,e,r){"use strict";var n=/"']|"[^"]*"|'[^']*')*>/;var a={root:n,width:/\swidth=(['"])([^%]+?)\1/,height:/\sheight=(['"])([^%]+?)\1/,viewbox:/\sviewBox=(['"])(.+?)\1/},i={cm:96/2.54,mm:96/2.54/10,m:96/2.54*100,pt:96/72,pc:96/72/12,em:16,ex:8};function o(t){var e=/([0-9.]+)([a-z]*)/.exec(t);if(e)return Math.round(parseFloat(e[1])*(i[e[2]]||1))}function l(t){var e=t.split(" ");return{width:o(e[2]),height:o(e[3])}}e.exports={detect:function(t){return n.test(t)},calculate:function(t){var e=t.toString("utf8").match(a.root);if(e){var r=function(t){var e=t.match(a.width),r=t.match(a.height),n=t.match(a.viewbox);return{width:e&&o(e[2]),height:r&&o(r[2]),viewbox:n&&l(n[2])}}(e[0]);if(r.width&&r.height)return function(t){return{width:t.width,height:t.height}}(r);if(r.viewbox)return function(t){var e=t.viewbox.width/t.viewbox.height;return t.width?{width:t.width,height:Math.floor(t.width/e)}:t.height?{width:Math.floor(t.height*e),height:t.height}:{width:t.viewbox.width,height:t.viewbox.height}}(r)}throw new TypeError("invalid svg")}}},{}],71:[function(t,e,r){(function(r){(function(){"use strict";var n=t("fs"),a=t("../readUInt");function i(t,e){var r=a(t,16,8,e);return(a(t,16,10,e)<<16)+r}function o(t){if(t.length>24)return t.slice(12)}e.exports={detect:function(t){var e=t.toString("hex",0,4);return"49492a00"===e||"4d4d002a"===e},calculate:function(t,e){if(!e)throw new TypeError("Tiff doesn't support buffer");var l="BE"===function(t){var e=t.toString("ascii",0,2);return"II"===e?"LE":"MM"===e?"BE":void 0}(t),s=function(t,e){for(var r,n,l,s={};t&&t.length&&(r=a(t,16,0,e),n=a(t,16,2,e),l=a(t,32,4,e),0!==r);)1!==l||3!==n&&4!==n||(s[r]=i(t,e)),t=o(t);return s}(function(t,e,i){var o=a(t,32,4,i),l=1024,s=n.statSync(e).size;o+l>s&&(l=s-o-10);var c=r.alloc(l),u=n.openSync(e,"r");return n.readSync(u,c,0,l,o),c.slice(2)}(t,e,l),l),c=s[256],u=s[257];if(!c||!u)throw new TypeError("Invalid Tiff, missing tags");return{width:c,height:u}}}}).call(this)}).call(this,t("buffer").Buffer)},{"../readUInt":59,buffer:18,fs:16}],72:[function(t,e,r){"use strict";e.exports={detect:function(t){var e="RIFF"===t.toString("ascii",0,4),r="WEBP"===t.toString("ascii",8,12),n="VP8"===t.toString("ascii",12,15);return e&&r&&n},calculate:function(t){var e=t.toString("ascii",12,16);if(t=t.slice(20,30),"VP8X"===e){var r=t[0];return!(!(0==(192&r))||!(0==(1&r)))&&function(t){return{width:1+t.readUIntLE(4,3),height:1+t.readUIntLE(7,3)}}(t)}if("VP8 "===e&&47!==t[0])return function(t){return{width:16383&t.readInt16LE(6),height:16383&t.readInt16LE(8)}}(t);var n=t.toString("hex",3,6);return"VP8L"===e&&"9d012a"!==n&&function(t){return{width:1+((63&t[2])<<8|t[1]),height:1+((15&t[4])<<10|t[3]<<2|(192&t[2])>>6)}}(t)}}},{}],73:[function(t,e,r){e.exports=!0},{}],74:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],75:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],76:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(l=e,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],77:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length2){var s=n.lastIndexOf("/");if(s!==n.length-1){-1===s?(n="",a=0):a=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),i=l,o=0;continue}}else if(2===n.length||1===n.length){n="",a=0,i=l,o=0;continue}e&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+t.slice(i+1,l):n=t.slice(i+1,l),a=l-i-1;i=l,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var a={resolve:function(){for(var e,a="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var l;o>=0?l=arguments[o]:(void 0===e&&(e=t.cwd()),l=e),r(l),0!==l.length&&(a=l+"/"+a,i=47===l.charCodeAt(0))}return a=n(a,!i),i?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),a=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&a&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var n=1;nc){if(47===e.charCodeAt(l+f))return e.slice(l+f+1);if(0===f)return e.slice(l+f)}else o>c&&(47===t.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var d=t.charCodeAt(n+f);if(d!==e.charCodeAt(l+f))break;47===d&&(u=f)}var p="";for(f=n+u+1;f<=i;++f)f!==i&&47!==t.charCodeAt(f)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(l+u):(l+=u,47===e.charCodeAt(l)&&++l,e.slice(l))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,a=-1,i=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){a=o;break}}else i=!1;return-1===a?n?"/":".":n&&1===a?"//":t.slice(0,a)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,a=0,i=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var l=e.length-1,s=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!o){a=n+1;break}}else-1===s&&(o=!1,s=n+1),l>=0&&(c===e.charCodeAt(l)?-1==--l&&(i=n):(l=-1,i=s))}return a===i?i=s:-1===i&&(i=t.length),t.slice(a,i)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){a=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":t.slice(a,i)},extname:function(t){r(t);for(var e=-1,n=0,a=-1,i=!0,o=0,l=t.length-1;l>=0;--l){var s=t.charCodeAt(l);if(47!==s)-1===a&&(i=!1,a=l+1),46===s?-1===e?e=l:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=l+1;break}}return-1===e||-1===a||0===o||1===o&&e===a-1&&e===n+1?"":t.slice(e,a)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,a=t.charCodeAt(0),i=47===a;i?(e.root="/",n=1):n=0;for(var o=-1,l=0,s=-1,c=!0,u=t.length-1,f=0;u>=n;--u)if(47!==(a=t.charCodeAt(u)))-1===s&&(c=!1,s=u+1),46===a?-1===o?o=u:1!==f&&(f=1):-1!==o&&(f=-1);else if(!c){l=u+1;break}return-1===o||-1===s||0===f||1===f&&o===s-1&&o===l+1?-1!==s&&(e.base=e.name=0===l&&i?t.slice(1,s):t.slice(l,s)):(0===l&&i?(e.name=t.slice(1,o),e.base=t.slice(1,s)):(e.name=t.slice(l,o),e.base=t.slice(l,s)),e.ext=t.slice(o,s)),l>0?e.dir=t.slice(0,l-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}).call(this)}).call(this,t("_process"))},{_process:87}],79:[function(t,e,r){ /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":80,"./lib/epsilon":81,"./lib/geojson":82,"./lib/intersecter":83,"./lib/segment-chainer":85,"./lib/segment-selector":86}],80:[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")}}}},{}],81:[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 a=r[0],i=r[1],o=n[0],l=n[1],s=e[0];return(o-a)*(e[1]-i)-(l-i)*(s-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(l=!l),i=c,o=u}return l}};return e}},{}],82:[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]),a=1;a0}))}function u(t,n){var a=t.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,l,c,u);if(!1===f){if(!e.pointsCollinear(o,l,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(l,u);if(d&&p)return n;var h=!d&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(n,l):s(t,u),n;h&&(p||(g?s(n,l):s(t,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(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 t=u(d,h);if(t)return t}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(t)(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(t)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 t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],s=0;s1)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=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;n=o(s,l,t+1/3),a=o(s,l,t),i=o(s,l,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,h,g;return i=C(i),{ok:f,format:e.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}}(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=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(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,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 t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)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 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=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 d(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=[P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16)),P(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,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*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(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(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(t,e){return t.apply(null,[this].concat([].slice.call(e)))},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(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:E(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:s(),g:s(),b:s()})},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,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(e[u]));return c.isReadable(t,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(t,["#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(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(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,l(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function D(t){return o(1,l(0,t))}function z(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/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(t){return!!H.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],89:[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}]},{}],90:[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;t("../../constants/axis_placeable_objects");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"}}})},{"../../constants/axis_placeable_objects":208,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":285,"../../plots/font_attributes":307,"./arrow_paths":89}],91:[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),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&l(e,r),"range"===o&&l(e,n)}))}function l(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],l=t["a"+i],s=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],f=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,h=p+d,g=p-d,v=3*t.startarrowsize*t.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(e,[e.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(e,[e.r2c(o)],{ppadplus:Math.max(u,h,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":233,"../../plots/cartesian/axes":279,"./draw":96}],92:[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,s,c,u=t._fullLayout.annotations,f=[],d=[],p=[],h=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,l,s=o(t,e),c=s.on,u=s.off.concat(s.explicitOff),f={},d=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 Y=!1,X=["x","y"],W=0;W1)&&(nt===rt?((pt=at.r2fraction(e["a"+et]))<0||pt>1)&&(Y=!0):Y=!0),Q=at._offset+at.r2p(e[et]),K=.5}else{var ht="domain"===dt;"x"===et?($=e[et],Q=ht?at._offset+at._length*$:Q=T.l+T.w*$):($=1-e[et],Q=ht?at._offset+at._length*$:Q=T.t+T.h*$),K=e.showarrow?.5:$}if(e.showarrow){ft.head=Q;var gt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-lt*q(.5,e.yanchor),nt===rt){var vt=s.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=T.t+T.h*gt):ft.tail=T.l+T.w*gt:ft.tail=at._offset+at.r2p(gt),J=tt}else ft.tail=Q+gt,J=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else J=tt=st*q(K,ct),ft.text=Q+tt;ft.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=st/2+J,e["_"+et+"padminus"]=st/2-J,e["_"+et+"size"]=st,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(M-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+bt-1,y:B+_t}).call(u.setClipUrl,j?C:null,t);else{var wt=B+_t-g.top,Tt=B+bt-g.left;G.call(d.positionText,Tt,wt).call(u.setClipUrl,j?C:null,t)}U.select("rect").call(u.setRect,B,B,M,I),H.call(u.setRect,F/2,F/2,N-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-V/2)),P.attr({transform:"rotate("+D+","+O.x.text+","+O.y.text+")"});var kt,Mt=function(r,n){z.selectAll(".annotation-arrow-g").remove();var s=O.x.head,f=O.y.head,d=O.x.tail+r,p=O.y.tail+n,g=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(D,g,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),C=+H.attr("width"),E=+H.attr("height"),I=g-.5*C,F=I+C,N=b-.5*E,B=N+E,j=[[I,N,I,B],[I,B,F,B],[F,B,F,N],[F,N,I,N]].map(M);if(!j.reduce((function(t,e){return t^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){j.forEach((function(t){var e=o.segmentsIntersect(d,p,s,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)}));var U=e.arrowwidth,V=e.arrowcolor,q=e.arrowside,G=z.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(V));if(v(Z,q,e),k.annotationPosition&&Z.node().parentNode&&!i){var Y=s,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Y+=e.standoff*(d-s)/W,X+=e.standoff*(p-f)/W}var Q,J,$=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Y)+","+(p-X),transform:l(Y,X)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:$.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);Q=t.x,J=t.y,m&&m.autorange&&A(m._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(Q,J),a=n[0]+t,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",y(m,t,"x",T,e)),L("y",y(x,r,"y",T,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",T,e)),e.ayref===e.yref&&L("ay",y(x,r,"ay",T,e)),G.attr("transform",l(t,r)),P.attr({transform:"rotate("+D+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),E)h.init({element:R.node(),gd:t,prepFn:function(){kt=P.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",T,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(x,r,"ay",T.w,e)):L("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",T,e);else{var s=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-s/2;a=h.align(c+t/T.w,s,0,1,e.xanchor)}if(x)o=y(x,r,"y",T,e);else{var u=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,e.yanchor)}L("x",a),L("y",o),m&&x||(n=h.getCursor(m?.5:a,x?.5:o,e.xanchor,e.yanchor))}P.attr({transform:l(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Z(n))},doneFn:function(){p(R),a.call("_guiRelayout",t,S());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,x=e.indexOf("end")>=0,b=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(d=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void E();if(b){if(b*b>w*w+T*T)return void E();var k=b*Math.cos(f),M=b*Math.sin(f);u.x+=k,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void E();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),C="";if(S1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":310,"../annotations/draw":96}],103:[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),l=0;l=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}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(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||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(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,s))),(a.isDark()?e?a.lighten(e):s:r?a.darken(r):l).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>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var Q=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Y*=Q*c.roundUp(W/Q,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(Z.tick0=0)}Z.dtick=Y}Z.domain=[V+H,V+F-H],Z.setScale(),t.attr("transform",u(Math.round(s.l),Math.round(s.t)));var J,$=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),K=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:Z,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+l+",."+l+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=s.l+(e.x+N)*s.w,n=Z.title.font.size;t="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,et(Z._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+M.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],d=i.select(".h"+Z._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(tt=p.bBox(d).height)>h&&(f[1]-=(tt-h)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=p.bBox(o.node()).height),tt){if(tt+=5,"top"===A)Z.domain[1]-=tt/s.h,f[1]*=-1;else{Z.domain[0]+=tt/s.h;var g=v.lineCount(o);f[1]+=(1-g)*h}i.attr("transform",u(f[0],f[1])),Z.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(s.h*(1-Z.domain[1])))),K.attr("transform",u(0,Math.round(-s.t)));var y=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(z);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var x=L.map(Z.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?L[0]:(z[i]+z[i-1])/2,i===z.length-1?L[1]:(z[i]+z[i+1])/2].map(Z.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:j,width:Math.max(E,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)p.gradient(l,r,e._id,"vertical",e._fillgradient,"fill");else{var s=C(t).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=t.select("."+M.cblines).selectAll("path."+M.cbline).data(m.color&&m.width?P:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(Z.c2p(t))+m.width/2%1)+"h"+E).call(p.lineGroupStyle,m.width,S(t),m.dash)})),K.selectAll("g."+Z._id+"tick,path").remove();var _=j+E+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=l.calcTicks(Z),k=l.getTickSigns(Z)[2];return l.drawTicks(r,Z,{vals:"inside"===Z.ticks?l.clipEnds(Z,T):T,layer:K,path:l.makeTickPath(Z,_,k),transFn:l.makeTransTickFn(Z)}),l.drawLabels(r,Z,{vals:T,layer:K,transFn:l.makeTransTickLabelFn(Z),labelFns:l.makeLabelFns(Z,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=Z.title.font.size,e=Z._offset+Z._length/2,a=s.l+(Z.position||0)*s.w+("right"===Z.side?10+t*(Z.showticklabels?1:.5):-10-t*(Z.showticklabels?.5:0));et("h"+Z._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Z._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=E+e.outlinewidth/2;if(-1===Z.ticklabelposition.indexOf("inside")&&(n+=p.bBox(K.node()).width),(J=$.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=$.select(".h"+Z._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox($.node()).right-j-s.l,n=Math.max(n,a)}var l=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-G;t.select("."+M.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(l,2),height:Math.max(c+2*B,2)}).call(h.fill,e.bgcolor).call(h.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:j,y:G+e.ypad+("top"===A?tt:0),width:Math.max(E,2),height:Math.max(c-2*e.ypad-tt,2)}).call(h.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*l;t.attr("transform",u(s.l-f,s.t));var d={},g=T[e.yanchor],v=k[e.yanchor];"pixels"===e.lenmode?(d.y=e.y,d.t=c*g,d.b=c*v):(d.t=d.b=0,d.yt=e.y+e.len*g,d.yb=e.y-e.len*v);var m=T[e.xanchor],y=k[e.xanchor];if("pixels"===e.thicknessmode)d.x=e.x,d.l=l*m,d.r=l*y;else{var x=l-E;d.l=x*m,d.r=x*y,d.xl=e.x-e.thickness*m,d.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,d)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,l=r._fullLayout._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),d(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),a=s.align(e._xLeftFrac+r/l.w,e._thickFrac,0,1,e.xanchor),i=s.align(e._yBottomFrac-o/l.h,e._lenFrac,0,1,e.yanchor);var c=s.getCursor(a,i,e.xanchor,e.yanchor);d(t,c)},doneFn:function(){if(d(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":207,"../../lib":233,"../../lib/extend":227,"../../lib/setcursor":253,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../plots/cartesian/axis_defaults":281,"../../plots/cartesian/layout_attributes":293,"../../plots/cartesian/position_defaults":296,"../../plots/plots":313,"../../registry":326,"../color":105,"../colorscale/helpers":116,"../dragelement":124,"../drawing":127,"../titles":200,"./constants":107,d3:21,tinycolor2:88}],110:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":233}],111:[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":106,"./defaults":108,"./draw":109,"./has_colorbar":110}],112:[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,l=(e=e||{}).cLetter||"c",s=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===l,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.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"},e.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!==e.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),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":249,"../colorbar/attributes":106,"./scales.js":120}],113:[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,l=t._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,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":233,"./helpers":116,"fast-isnumeric":23}],114:[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 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=t[n];r[a]=[1-i[0],i[1]]}return r}function h(t,e){e=e||{};for(var r=t.domain,o=t.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],122:[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":233}],123:[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)}},{}],124:[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,l=t("../../plots/cartesian/constants"),s=e.exports={};s.align=t("./align"),s.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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(t){var e,r,n,c,d,p,h,g,v=t.gd,m=1,y=v._context.doubleClickDelay,x=t.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=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,p),!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)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":233,"../../plots/cartesian/constants":285,"./align":121,"./cursor":122,"./unhover":125,"has-hover":54,"has-passive-events":55,"mouse-event-offset":76}],125:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.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":225,"../../lib/events":226,"../../lib/throttle":256,"../fx/constants":139}],126:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],127:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=c.strTranslate,f=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,h=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),m=t("../../components/fx/helpers").appendArrayPointValue,y=e.exports={};y.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(l.fill,n)},y.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},y.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},y.setRect=function(t,e,r,n,a){t.call(y.setPosition,e,r).call(y.setSize,n,a)},y.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",u(i,o)),!0)},y.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);y.translatePoint(t,a,e,r)}))},y.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},y.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){y.hideOutsideRangePoint(t,n.select(this),r,a,l,s)}))}))}},y.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},y.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(e,n||i.color),y.dashLine(e,s,o)},y.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(y.dashLine,s,o)}))},y.dashLine=function(t,e,r){r=+r||0,e=y.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},y.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},y.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},y.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(l.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");y.symbolNames=[],y.symbolFuncs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolNoFill={},y.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;y.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),y.symbolNames[r]=t,y.symbolFuncs[r]=e.f,e.needLine&&(y.symbolNeedLines[r]=!0),e.noDot?y.symbolNoDot[r]=!0:y.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(y.symbolNoFill[r]=!0)}));var b=y.symbolNames.length;function _(t,e){var r=t%100;return y.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}y.symbolNumber=function(t){if(a(t))t=+t;else 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=y.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},T={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:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};y.gradient=function(t,e,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p"+m(t);h._gradientUrlQueryParts[y]=1},y.initGradients=function(t){var e=t._fullLayout;c.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},y.pointStyle=function(t,e,r){if(t.size()){var a=y.makePointStyleFns(e);t.each((function(t){y.singlePointStyle(t,n.select(this),e,a,r)}))}},y.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 s;s="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=s,n.selectedSizeFn&&(s=t.mrc=n.selectedSizeFn(t));var u=y.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",_(u,s))}var f,d,p,h=!1;if(t.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!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(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var v=i.gradient,m=t.mgt;if(m?h=!0:m=v&&v.type,Array.isArray(m)&&(m=m[0],M[m]||(m=0)),m&&"none"!==m){var x=t.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+t.i),y.gradient(e,a,b,m,[[0,x],[1,f]],"fill")}else l.fill(e,f);p&&l.stroke(e,d)}},y.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=y.tryColorscale(r,""),e.lineScale=y.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,y.makeSelectedPointStyleFns(t)),e},y.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(c.isArrayOrTypedArray(s)||d||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:p?f:h*e});var g=a.color,v=i.color,m=l.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,x=i.size,b=l.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},y.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,h))},e},y.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.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){l.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",_(y.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}y.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=y.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,l=r._fullLayout;t.each((function(t){var i=n.select(this),s=o?c.extractOption(t,e,"txt","texttemplate"):c.extractOption(t,e,"tx","text");if(s||0===s){if(o){var u=e._module.formatLabels?e._module.formatLabels(t,e,l):{},d={};m(d,e,t.i);var p=e._meta||{};s=c.texttemplateString(s,u,l._d3locale,d,t,p)}var h=t.tp||e.textposition,g=S(t,e),v=a?a(t):t.tc||e.textfont.color;i.call(y.font,t.tf||e.textfont.family,g,v).text(s).call(f.convertToTspans,r).call(L,h,g,t.mrc)}else i.remove()}))}},y.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=S(t,e);l.fill(a,i),L(a,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[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(e[0]+(p&&f/p),2),n.round(e[1]+(p&&d/p),2)],[n.round(e[0]-(h&&f/h),2),n.round(e[1]-(h&&d/h),2)]]}y.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&&(y.savedBBoxes={},z=0),r&&(y.savedBBoxes[r]=v),z++,c.extendFlat({},v)},y.setClipUrl=function(t,e,r){t.attr("clip-path",E(e,r))},y.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}},y.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+=u(e,r)).trim(),t[a]("transform",i),i},y.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}},y.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.*/;y.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 R=/translate\([^)]*\)\s*$/;y.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),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(R);t=1===e&&1===r?[]:[u(o,l),"scale("+e+","+r+")",u(-o,-l)],s&&t.push(s),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":141,"../../constants/alignment":207,"../../constants/interactions":211,"../../constants/xmlns_namespaces":213,"../../lib":233,"../../lib/svg_text_utils":255,"../../registry":326,"../../traces/scatter/make_bubble_size_func":464,"../../traces/scatter/subtypes":472,"../color":105,"../colorscale":117,"./symbol_defs":128,d3:21,"fast-isnumeric":23,tinycolor2:88}],128:[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),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"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},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{d3:21}],129:[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"}}}},{}],130:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),l=t("./compute_error");function s(t,e,r,a){var s=e["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;e.each((function(e){var f,d=e[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.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,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,s,c);if(!g||t.vis){var i,o=e.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=e.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=e.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=e.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":472,"../drawing":127,d3:21,"fast-isnumeric":23}],135:[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":105,d3:21}],136:[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":227,"../../plots/font_attributes":307,"./layout_attributes":146}],137:[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 l=0;l=0&&r.indexb[0]._length||tt<0||tt>_[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=K+b[0]._offset,e.pointerY=tt+_[0]._offset,C="xval"in e?m.flat(l,e.xval):m.p2c(b,K),D="yval"in e?m.flat(l,e.yval):m.p2c(_,tt),!a(C[0])||!a(D[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var nt=1/0;function at(t,r){for(F=0;FZ&&(W.splice(0,Z),nt=W[0].distance),g&&0!==X&&0===W.length){G.distance=X,G.index=!1;var f=B._module.hoverPoints(G,V,q,"closest",s._hoverlayer);if(f&&(f=f.filter((function(t){return t.spikeDistance<=X}))),f&&f.length){var d,h=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=ot(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>d.spikeDistance)&&(J.vLinePoint=d))}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)&&(d=ot(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>d.spikeDistance)&&(J.hLinePoint=d))}}}}}function it(t,e){for(var r,n=null,a=1/0,i=0;i1||W.length>1)||"closest"===L&&$&&W.length>1,At=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),Lt={hovermode:L,rotateLabels:Mt,bgColor:At,container:s._hoverlayer,outerContainer:s._paperdiv,commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance},St=O(W,Lt,t);m.isUnifiedHover(L)||(!function(t,e,r){var n,a,i,o,l,s,c,u=0,f=1,d=t.size(),p=new Array(d),h=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(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].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--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[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 _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(St,Mt?"xa":"ya",s),z(St,Mt,s._invScaleX,s._invScaleY));if(e.target&&e.target.tagName){var Ct=v.getComponentMethod("annotations","hasClickToShow")(t,_t);f(n.select(e.target),Ct?"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:b,yaxes:_,xvals:C,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||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}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:i,outerContainer:o},s=O(a,l,e.gd),c=0,u=0;s.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 O(t,e,r){var a=r._fullLayout,i=e.hovermode,c=e.rotateLabels,f=e.bgColor,h=e.container,g=e.outerContainer,v=e.commonLabelOpts||{},w=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,k=t[0],M=k.xa,C=k.ya,O="y"===i.charAt(0)?"yLabel":"xLabel",z=k[O],P=(String(z)||"").split(" ")[0],E=g.node().getBoundingClientRect(),I=E.top,R=E.width,F=E.height,N=void 0!==z&&k.distance<=e.hoverdistance&&("x"===i||"y"===i);if(N){var B,H,j=!0;for(B=0;Ba.width-S?(y=a.width-S,s.attr("d","M"+(S-A)+",0L"+S+","+_+A+"v"+_+(2*L+b.height)+"H-"+S+"V"+_+A+"H"+(S-2*A)+"Z")):s.attr("d","M0,0L"+A+","+_+A+"H"+(L+b.width/2)+"v"+_+(2*L+b.height)+"H-"+(L+b.width/2)+"V"+_+A+"H-"+A+"Z")}else{var O,D,P;"right"===C.side?(O="start",D=1,P="",y=M._offset+M._length):(O="end",D=-1,P="-",y=M._offset),x=C._offset+(k.y0+k.y1)/2,c.attr("text-anchor",O),s.attr("d","M0,0L"+P+A+","+A+"V"+(L+b.height/2)+"h"+P+(2*L+b.width)+"V-"+(L+b.height/2)+"H"+P+A+"V-"+A+"Z");var E,R=b.height/2,F=I-b.top-R,N="clip"+a._uid+"commonlabel"+C._id;if(y=0?et-=at:et+=2*L;var it=nt.height+2*L,ot=tt+it>=F;return it<=F&&(tt<=I?tt=C._offset+2*L:ot&&(tt=F-it)),rt.attr("transform",l(et,tt)),rt}var lt=h.selectAll("g.hovertext").data(t,(function(t){return S(t)}));return lt.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(p.fill,p.addOpacity(f,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(d.font,w,T)})),lt.exit().remove(),lt.each((function(t){var e=n.select(this).attr("transform",""),o=t.color;Array.isArray(o)&&(o=o[t.eventData[0].pointNumber]);var h=t.bgcolor||o,g=p.combine(p.opacity(h)?h:p.defaultLine,f),v=p.combine(p.opacity(o)?o:p.defaultLine,f),m=t.borderColor||p.contrast(g),y=D(t,N,i,a,z,e),x=y[0],b=y[1],k=e.select("text.nums").call(d.font,t.fontFamily||w,t.fontSize||T,t.fontColor||m).text(x).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r),M=e.select("text.name"),S=0,C=0;if(b&&b!==x){M.call(d.font,t.fontFamily||w,t.fontSize||T,v).text(b).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r);var O=M.node().getBoundingClientRect();S=O.width+2*L,C=O.height+2*L}else M.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:m});var P,E,B=k.node().getBoundingClientRect(),H=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),V=Math.abs(t.y1-t.y0),q=B.width+A+L+S;if(t.ty0=I-B.top,t.bx=B.width+2*L,t.by=Math.max(B.height+2*L,C),t.anchor="start",t.txwidth=B.width,t.tx2width=S,t.offset=0,c)t.pos=H,P=j+V/2+q<=F,E=j-V/2-q>=0,"top"!==t.idealAlign&&P||!E?P?(j+=V/2,t.anchor="start"):t.anchor="middle":(j-=V/2,t.anchor="end");else if(t.pos=j,P=H+U/2+q<=R,E=H-U/2-q>=0,"left"!==t.idealAlign&&P||!E)if(P)H+=U/2,t.anchor="start";else{t.anchor="middle";var G=q/2,Z=H+G-R,Y=H-G;Z>0&&(H-=Z),Y<0&&(H+=-Y)}else H-=U/2,t.anchor="end";k.attr("text-anchor",t.anchor),S&&M.attr("text-anchor",t.anchor),e.attr("transform",l(H,j)+(c?s(_):""))})),lt}function D(t,e,r,n,a,i){var l="",s="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),l=R(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(s+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(s+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(s+=(s?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?s=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(s=t.yLabel):s=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(s+=(s?"
":"")+t.text),void 0!==t.extraText&&(s+=(s?"
":"")+t.extraText),i&&""===s&&!t.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=t.hovertemplate||!1,f=t.hovertemplateLabels||t,d=t.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,t.trace._meta)).replace(C,(function(e,r){return l=R(r,t.nameLength),""}))),[s,l]}function z(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),l=t.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(t.txwidth+L),h=0,g=t.offset,v="middle"===l;v&&(f-=t.tx2width/2,p+=t.txwidth/2+L),e&&(g*=-M,h=t.offset*k),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(t.by/2-A)+"h"+i(s*t.bx)+"v-"+o(t.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+t.ty0-t.by/2+L,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-L:t.bx+L)),a.call(u.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(g+t.ty0-t.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*t.tx2width/2+h),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],l=t.cd[r]||{};function s(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return s(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(l,n,t,e)};function u(e,r,n){var a=c(r,n);s(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:g.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.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=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.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 d=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"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 E(t,e,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=e.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,h)<1.5?p.contrast(h):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=g.getPxPosition(t,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":d.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:h}).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(f){var S,C,O=e.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 D,z,P=i.readability(O.color,h)<1.5?p.contrast(h):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||P,F=g.getPxPosition(t,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(D=F,z=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)),D=s.t+(1-B)*s.h,z=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:z,"stroke-width":I,stroke:R,"stroke-dasharray":d.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:z,"stroke-width":I+2,stroke:h}).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 I(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function R(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":233,"../../lib/events":226,"../../lib/override_cursor":244,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"../legend/defaults":157,"../legend/draw":158,"./constants":139,"./helpers":141,d3:21,"fast-isnumeric":23,tinycolor2:88}],143:[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 l(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={}),l("size"),l("family"),l("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":233,"../color":105,"./helpers":141}],144:[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,l=i("clickmode");return e._has("cartesian")?l.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._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&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete e.grid}function k(t,e){return n.coerce(r,v,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,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(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemwidth"),_("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",e.font))}}function _(t,e){return a.coerce(c,v,o,t,e)}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../plots/layout_attributes":311,"../../registry":326,"./attributes":155,"./helpers":161}],158:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.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,s={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&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",s))if(1===n)e._clickTimeout=setTimeout((function(){d(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",s)&&d(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&e._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(t,"text","legendtext");g.attr("text-anchor","start").call(c.font,r.font).text(d?T(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,h)).call(M,t,e,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",e,s,u)})):M(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,l=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function M(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,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=t.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);if(n){var x=r.itemwidth+2*p.itemGap;f.positionText(h,x,-y)}else 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)}(e,r,n)}))}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function L(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,l=t._fullLayout,f="legend"+l._uid;if(e?(r=e.layer,f+="-hover"):((e=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;d=l.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;d=y(e.entries,e)}var h=l.hiddenlabels||[];if(e._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(t){t.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));S.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=e.title;if(e._titleWidth=0,e._titleHeight=0,O.text){var D=a.ensureSingle(C,"text","legendtitletext");D.attr("text-anchor","start").call(c.font,O.font).text(O.text),M(D,C,t,e)}else C.selectAll(".legendtitletext").remove();var z=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),P=C.selectAll("g.groups").data(d);P.enter().append("g").attr("class","groups"),P.exit().remove();var E=P.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==h.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,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.itemGap,h=a.itemwidth+2*d,g=2*(u+d),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(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(l)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=h+a._width,a._width+=d+h+f,a._height+=g,s&&(e.each((function(t,e){c.setTranslate(this,0,e*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*h);var C=0,O=0;r.each((function(t){var e=t[0].width+h;C=Math.max(C,e),O+=e})),x=null;var D=0;if(s){var z=0,P=0,E=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,h+r[0].width)})),z=Math.max(z,e);var r=t+d;r+u+P>a._maxWidth&&(D=Math.max(D,P),P=0,E+=z+a.tracegroupgap,z=e),c.setTranslate(this,P,E),P+=r})),a._width=Math.max(D,P)+u,a._height=E+z+g}else{var I=r.size(),R=O+f+(I-1)*d=a._maxWidth&&(D=Math.max(D,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+e/2+d),H=N+r+d,N+=n,F=Math.max(F,e)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(D,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=t._context.edits,U=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=U?h:x||h+t[0].width;l||(a+=d/2),c.setRect(e,0,-r/2,a,r)}))}(t,P,E,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=A(e),n=L(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 u,d,h,y,x=l._size,b=e.borderwidth,w=x.l+x.w*e.x-v[A(e)]*e._width,k=x.t+x.h*(1-e.y)-v[L(e)]*e._effHeight;if(e._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-e._width),k=a.constrain(k,0,l.height-e._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(e._main&&c.setTranslate(g,w,k),z.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;e._main||(D=e._height),S.attr({width:e._width-b,height:D-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:e._width-2*b,height:D-2*b,x:b,y:b}),c.setClipUrl(C,f,t),c.setRect(z,0,0,0,0),delete e._scrollY}else{var P,E,I,R=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*p.scrollBarMargin,N=e._height-e._effHeight,B=F/N,H=Math.min(e._scrollY||0,N);S.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+H}),c.setClipUrl(C,f,t),V(H,R,B),g.on("wheel",(function(){V(H=a.constrain(e._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 t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=H})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(E="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(H=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,N)}(I,P,E),R,B))}));z.call(j);var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,I=H)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(E=t.changedTouches[0].clientY,V(H=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,N)}(I,P,E),R,B))}));C.call(U)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:t,prepFn:function(){var t=c.getTranslate(g);h=t.x,y=t.y},moveFn:function(t,r){var n=h+t,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,e.xanchor),d=s.align(a,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":d})},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 V(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(z,e._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],t)}}},{"../../constants/alignment":207,"../../lib":233,"../../lib/events":226,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"./constants":156,"./get_legend_data":159,"./handle_click":160,"./helpers":161,"./style":163,d3:21}],159:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=e._main;function p(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=e.width}return v?n:Math.min(a,r)};function _(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",x),u.exit().remove(),u.each((function(t){var e=n.select(this),r=t[0],a=b(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 w(t,e,r){var o=t[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(s?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=b(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var g=i.minExtend(o,{trace:h});f(c,g,h)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var l=r.valign,s=t[0].lineHeight,c=t[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(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 f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["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":o=[["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":o=[["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":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["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(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",x).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),d=c(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;u=0===o?p[g?v-1:0][1]:1===o?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(s.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;l.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,_(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",x).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=b(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){_(t,this,"funnel")})).each((function(t){_(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),o.exit().remove(),o.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=b(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:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,e)}}))})).each((function(t){w(t,this,"funnelarea")})).each((function(t){w(t,this,"pie")})).each((function(t){var r,a,o=t[0],s=o.trace,f=s.visible&&s.fill&&"none"!==s.fill,d=u.hasLines(s),p=s.contours,g=!1,v=!1,y=c(s),x=y.colorscale,_=y.reversescale;if(p){var w=p.coloring;"lines"===w?g=!0:d="none"===w||"heatmap"===w||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==w&&"heatmap"!==w||(v=!0)}var T=u.hasMarkers(s)||u.hasText(s),k=f||v,M=d||g,A=T||!k?"M5,0":M?"M5,-2":"M5,-3",L=n.select(this),S=L.select(".legendfill").selectAll("path").data(f||v?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+m+"v6h-"+m+"z").call(f?l.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+s.uid;l.gradient(t,e,r,h(_),x,"fill")}}),d||g){var C=b(void 0,s.line,10,5);a=i.minExtend(s,{line:{width:C}}),r=[i.minExtend(o,{trace:a})]}var O=L.select(".legendlines").selectAll("path").data(d||g?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",A+(g?"l"+m+",0.0001":"h"+m)).call(d?l.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+s.uid;l.lineGroupStyle(t),l.gradient(t,e,r,h(_),x,"stroke")}})})).each((function(t){var r,a,o=t[0],s=o.trace,c=u.hasMarkers(s),f=u.hasText(s),d=u.hasLines(s);function p(t,e,r,n){var a=i.nestedProperty(s,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function h(t){return o._distinct&&o.index&&t[o.index]?t[o.index]:t[0]}if(c||f||d){var g={},m={};if(c){g.mc=p("marker.color",h),g.mx=p("marker.symbol",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);g.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",h,[0,10],5)}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(o,g)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var b=n.select(this).select("g.legendpoints"),_=b.selectAll("path.scatterpts").data(c?r:[]);_.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",x),_.exit().remove(),_.call(l.pointStyle,a,e),c&&(r[0].mrc=3);var w=b.selectAll("g.pointtext").data(f?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",x),w.exit().remove(),w.selectAll("text").call(l.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",x).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=b(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",x).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=b(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":233,"../../registry":326,"../../traces/pie/helpers":439,"../../traces/pie/style_one":445,"../../traces/scatter/subtypes":472,"../color":105,"../colorscale/helpers":116,"../drawing":127,"./constants":156,d3:21}],164:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),l=t("../shapes/draw").eraseActiveShape,s=t("../../lib"),c=s._,u=e.exports={};function f(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d=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(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?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");W(n),$(l,r),function(t,e,r){var n=e.xref,a=e.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(t,s?"clip"+r._fullLayout._uid+s:null,r)}(e,r,t),X.moveFn="move"===P?Q:J,X.altKey=n.altKey},doneFn:function(){if(m(t))return;p(e),K(l),b(e,t,r),n.call("_guiRelayout",t,s.getUpdateObj())},clickFn:function(){if(m(t))return;K(l)}};function W(r){if(m(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=X.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(e,s),P=s.split("-")[0]}}function Q(n,a){if("path"===r.type){var i=function(t){return t},o=i,s=i;E?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=Z(T+a)):(s=function(t){return Z(q(t)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(z,o,s))}else E?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(v+n))),I?N("yanchor",r.yanchor=Z(T+a)):(N("y0",r.y0=Z(f+a)),N("y1",r.y1=Z(y+a)));e.attr("d",_(t,r)),$(l,r)}function J(n,a){if(F){var i=function(t){return t},o=i,s=i;E?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=Z(T+a)):(s=function(t){return Z(q(t)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(z,o,s))}else if(R){if("resize-over-start-point"===P){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:G(u)),N("y0",r.y0=I?d:Z(d))}else if("resize-over-end-point"===P){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:G(p)),N("y1",r.y1=I?h:Z(h))}}else{var m=function(t){return-1!==P.indexOf(t)},b=m("n"),H=m("s"),U=m("w"),Y=m("e"),X=b?k+a:k,W=H?M+a:M,Q=U?A+n:A,J=Y?L+n:L;I&&(b&&(X=k-a),H&&(W=M-a)),(!I&&W-X>10||I&&X-W>10)&&(N(S,r[S]=I?X:Z(X)),N(C,r[C]=I?W:Z(W))),J-Q>10&&(N(O,r[O]=E?Q:G(Q)),N(D,r[D]=E?J:G(J)))}e.attr("d",_(t,r)),$(l,r)}function $(t,e){(E||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(E?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,h.paramIsX))),o=q(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.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 K(t){t.selectAll(".visual-cue").remove()}d.init(X),Y.node().onmousemove=W}(t,E,s,e,r,P):!0===s.editable&&E.style("pointer-events",D||c.opacity(L)*A<=.5?"stroke":"all");E.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,v(t)}}(t,E)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,l,s,c,u,f,d=e.type,p=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),x=t._fullLayout._size;if(m?"domain"===p?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},y?"domain"===v?l=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),l=function(t){return y._offset+y.r2p(o(t,!0))}):l=function(t){return x.t+x.h*(1-t)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(l=g.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(h.segmentRE,(function(t){var n=0,c=t.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=t.substr(1).replace(h.paramRE,(function(t){return u[n]?t="pixel"===i?e(l)+Number(t):e(t):f[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>d&&(t="X"),t}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,l);if("pixel"===e.xsizemode){var b=n(e.xanchor);s=b+e.x0,c=b+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var _=l(e.yanchor);u=_-e.y0,f=_-e.y1}else u=l(e.y0),f=l(e.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 w=(s+c)/2,T=(u+f)/2,k=Math.abs(w-s),M=Math.abs(T-u),A="A"+k+","+M,L=w+k+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+L+"Z"}function w(t,e,r){return t.replace(h.segmentRE,(function(t){var n=0,a=t.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+t.substr(1).replace(h.paramRE,(function(t){return n>=l||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(s(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;s(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),M&&!d)&&(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 z(t,r){!function(t,r){if(e.length)for(var n=0;n0&&s0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function D(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,m);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];e.attr("transform",s(m[0],m[1]))}}}return I.call(R),P&&(S?I.on(".opacity",null):(M=0,A=!0,I.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),I.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,m,e,x):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",A),T}}},{"../../constants/alignment":207,"../../constants/interactions":211,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../../registry":326,"../color":105,"../drawing":127,d3:21,"fast-isnumeric":23}],201:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(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":227,"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../../plots/font_attributes":307,"../../plots/pad_attributes":312,"../color/attributes":104}],202:[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"}}},{}],203:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":233,"../../plots/array_container_defaults":274,"./attributes":201,"./constants":202}],204:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.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(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,s.lx,s.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,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,t).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,l.method,l.args2)):(g(t,o,0,e,r,i,s),a.executeAPICommand(t,l.method,l.args))),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(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(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+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,D=l.barWidth+2*l.barPad,z=l.barLength+2*l.barPad,P=h+g,E=v;P+D>s&&(P=s-D);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:P,y:E,width:D,height:z}),this._vbarYMin=E+z/2,this._vbarTranslateMax=T-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+D+.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 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 V=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(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":233,"../color":105,"../drawing":127,d3:21}],207:[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"}}},{}],208:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],209:[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-time-format#locale_format"}},{}],210:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],211:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],212:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],213:[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}},{}],214:[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),l=0;lplotly-logomark"}}},{}],217:[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}},{}],218:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(t){return Math.abs(t[1]-t[0])>l-1e-14}function c(t,e){return i(e-t,l)}function u(t,e){if(s(e))return!0;var r,n;e[0](n=a(n,l))&&(n+=l);var i=a(t,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,d=l):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":240}],219:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function l(t){return n(t)||o(t)}function s(t,e,r){if(l(t)){if(l(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),m=t.charAt(0);!c||"G"!==m&&"g"!==m||(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],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 D=v.getComponentMethod("calendars","getCal")(e);if(w){var z="i"===M.charAt(M.length-1);M=parseInt(M,10),O=D.newDate(k,D.toMonthIndex(k,M,z),A)}else O=D.newDate(k,Number(M),A)}catch(t){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 P=new Date(Date.UTC(2e3,M,A,L,S));return P.setUTCFullYear(k),P.getUTCMonth()!==M||P.getUTCDate()!==A?u:P.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*f,k=3*d,M=5*p;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,l,c,y,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=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 u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":240}],231:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],232:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],233:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../constants/numerical"),l=o.FP_SAFE,s=o.BADNUM,c=e.exports={};c.nestedProperty=t("./nested_property"),c.keyedContainer=t("./keyed_container"),c.relativeAttr=t("./relative_attr"),c.isPlainObject=t("./is_plain_object"),c.toLogRange=t("./to_log_range"),c.relinkPrivateKeys=t("./relink_private");var u=t("./array");c.isTypedArray=u.isTypedArray,c.isArrayOrTypedArray=u.isArrayOrTypedArray,c.isArray1D=u.isArray1D,c.ensureArray=u.ensureArray,c.concat=u.concat,c.maxRowLength=u.maxRowLength,c.minRowLength=u.minRowLength;var f=t("./mod");c.mod=f.mod,c.modHalf=f.modHalf;var d=t("./coerce");c.valObjectMeta=d.valObjectMeta,c.coerce=d.coerce,c.coerce2=d.coerce2,c.coerceFont=d.coerceFont,c.coerceHoverinfo=d.coerceHoverinfo,c.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,c.validate=d.validate;var p=t("./dates");c.dateTime2ms=p.dateTime2ms,c.isDateTime=p.isDateTime,c.ms2DateTime=p.ms2DateTime,c.ms2DateTimeLocal=p.ms2DateTimeLocal,c.cleanDate=p.cleanDate,c.isJSDate=p.isJSDate,c.formatDate=p.formatDate,c.incrementMonth=p.incrementMonth,c.dateTick0=p.dateTick0,c.dfltRange=p.dfltRange,c.findExactDates=p.findExactDates,c.MIN_MS=p.MIN_MS,c.MAX_MS=p.MAX_MS;var h=t("./search");c.findBin=h.findBin,c.sorterAsc=h.sorterAsc,c.sorterDes=h.sorterDes,c.distinctVals=h.distinctVals,c.roundUp=h.roundUp,c.sort=h.sort,c.findIndexOfMin=h.findIndexOfMin;var g=t("./stats");c.aggNums=g.aggNums,c.len=g.len,c.mean=g.mean,c.median=g.median,c.midRange=g.midRange,c.variance=g.variance,c.stdev=g.stdev,c.interp=g.interp;var v=t("./matrix");c.init2dArray=v.init2dArray,c.transposeRagged=v.transposeRagged,c.dot=v.dot,c.translationMatrix=v.translationMatrix,c.rotationMatrix=v.rotationMatrix,c.rotationXYMatrix=v.rotationXYMatrix,c.apply3DTransform=v.apply3DTransform,c.apply2DTransform=v.apply2DTransform,c.apply2DTransform2=v.apply2DTransform2,c.convertCssMatrix=v.convertCssMatrix,c.inverseTransformMatrix=v.inverseTransformMatrix;var m=t("./angles");c.deg2rad=m.deg2rad,c.rad2deg=m.rad2deg,c.angleDelta=m.angleDelta,c.angleDist=m.angleDist,c.isFullCircle=m.isFullCircle,c.isAngleInsideSector=m.isAngleInsideSector,c.isPtInsideSector=m.isPtInsideSector,c.pathArc=m.pathArc,c.pathSector=m.pathSector,c.pathAnnulus=m.pathAnnulus;var y=t("./anchor_utils");c.isLeftAnchor=y.isLeftAnchor,c.isCenterAnchor=y.isCenterAnchor,c.isRightAnchor=y.isRightAnchor,c.isTopAnchor=y.isTopAnchor,c.isMiddleAnchor=y.isMiddleAnchor,c.isBottomAnchor=y.isBottomAnchor;var x=t("./geometry2d");c.segmentsIntersect=x.segmentsIntersect,c.segmentDistance=x.segmentDistance,c.getTextLocation=x.getTextLocation,c.clearLocationCache=x.clearLocationCache,c.getVisibleSegment=x.getVisibleSegment,c.findPointOnPath=x.findPointOnPath;var b=t("./extend");c.extendFlat=b.extendFlat,c.extendDeep=b.extendDeep,c.extendDeepAll=b.extendDeepAll,c.extendDeepNoArrays=b.extendDeepNoArrays;var _=t("./loggers");c.log=_.log,c.warn=_.warn,c.error=_.error;var w=t("./regex");c.counterRegex=w.counter;var T=t("./throttle");c.throttle=T.throttle,c.throttleDone=T.done,c.clearThrottle=T.clear;var k=t("./dom");function M(t){var e={};for(var r in t)for(var n=t[r],a=0;al?s:i(t)?Number(t):s:s},c.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},c.noop=t("./noop"),c.identity=t("./identity"),c.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))},c.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},c.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(c.warn("randstr failed uniqueness"),s):t(e,r,n,(a||0)+1):s},c.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},c.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},c.syncOrAsync=function(t,e,r){var n;function a(){return c.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,c.promiseError);return r&&r(e)},c.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},c.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},c.fillArray=function(t,e,r,n){if(n=n||c.identity,c.isArrayOrTypedArray(t))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},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;c.templateString=function(t,e){var r={};return t.replace(c.TEMPLATE_STRING_REGEX,(function(t,n){var a;return D.test(n)?a=e[n]:(r[n]=r[n]||c.nestedProperty(e,n).get,a=r[n]()),c.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=function(){return I.apply(z,arguments)};var P={max:10,count:0,name:"texttemplate"};c.texttemplateString=function(){return I.apply(P,arguments)};var E=/^[:|\|]/;function I(t,e,r){var i=this,o=arguments;e||(e={});var l={};return t.replace(c.TEMPLATE_STRING_REGEX,(function(t,s,u){var f,d,p,h;for(p=3;p=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;c.seedPseudoRandom=function(){R=2e9},c.pseudoRandom=function(){var t=R;return R=(69069*R+1)%4294967296,Math.abs(R-t)<429496729?c.pseudoRandom():R/4294967296},c.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=c.extractOption(t,e,"htx","hovertext");if(c.isValidTextValue(a))return n(a);var i=c.extractOption(t,e,"tx","text");return c.isValidTextValue(i)?n(i):void 0},c.isValidTextValue=function(t){return t||0===t},c.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,c.strTranslate(a-u*(r+o),i-u*(n+l))+c.strScale(u)+(s?"rotate("+s+(e?"":" "+r+" "+n)+")":"")},c.ensureUniformFontSize=function(t,e){var r=c.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},c.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)}},{"../constants/numerical":212,"./anchor_utils":217,"./angles":218,"./array":219,"./clean_number":220,"./clear_responsive":222,"./coerce":223,"./dates":224,"./dom":225,"./extend":227,"./filter_unique":228,"./filter_visible":229,"./geometry2d":230,"./identity":231,"./increment":232,"./is_plain_object":234,"./keyed_container":235,"./localize":236,"./loggers":237,"./make_trace_groups":238,"./matrix":239,"./mod":240,"./nested_property":241,"./noop":242,"./notifier":243,"./preserve_drawing_buffer":246,"./push_unique":247,"./regex":249,"./relative_attr":250,"./relink_private":251,"./search":252,"./stats":254,"./throttle":256,"./to_log_range":257,d3:21,"d3-time-format":19,"fast-isnumeric":23}],234:[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}},{}],235:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o1){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":266,"./notifier":243}],238:[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:21}],239:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],241:[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,l,s,c=t;for(l=0;l/g),s=0;si||c===a||cl)&&(!e||!s(t))}:function(t,e){var s=t[0],c=t[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],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(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":212,"./matrix":239}],246:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":23,"is-mobile":74}],247:[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,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t,e){var n,a=(e||{}).unitMinDiff,i=t.slice();for(i.sort(r.sorterAsc),n=i.length-1;n>-1&&i[n]===o;n--);var l=1;a||(l=i[n]-i[0]||1);for(var s,c=l/(n||1)/1e4,u=[],f=0;f<=n;f++){var d=i[f],p=d-s;void 0===s?(u.push(d),s=d):p>c&&(l=Math.min(l,p),u.push(d),s=d)}return{vals:u,minDiff:l}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;lt.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":219,"fast-isnumeric":23}],255:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),l=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var L=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(c),O=n.select(t.node().parentNode);if(!O.empty()){var D=t.attr("class")?t.attr("class").split(" ")[0]:"text";return D+="-math",O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),e,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(C[2],o,(function(n,a,o){O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return z(),void e();var c=O.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:D,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+t.attr("x")-d*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=-(r||s(t,"height"))/4;"y"===D[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-d/2,g-p/2)}),l.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===D[0]?l.attr({x:t.attr("x"),y:g-p/2}):"a"===D[0]&&0!==D.indexOf("atitle")?l.attr({x:0,y:g}):l.attr({x:h,y:+t.attr("y")+g-p/2}),A&&A.call(t,c),e(c)}))}))):z(),t}function z(){O.empty()||(D=t.attr("class")+"-math",O.select("svg."+D).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*l+"em"}),t.appendChild(e),r=e;var a=s;if(s=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,s=[{node:t}]);for(var C=e.split(m),O=0;O|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function C(t,e,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(t,e);t=s[0],e=s[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?s():i.timer=setTimeout((function(){s(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],257:[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":23}],258:[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"}}},{}],259:[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"}}},{}],260:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.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")),h(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",f);var y=r[""][""];if(c(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&&(d(v,m),p(t),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=u(m,f).get(),D=[],z=-1,P=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)?D.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)C.splice(D[x],1),O&&O.splice(D[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===z)E=L;else{for(P=Math.max(C.length,P),E=[],x=0;x=z);x++)E.push(_);for(x=z;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=z(r,t.data.length-1),e)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){if(t=o.getGraphDiv(t),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=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(q(t,i,a)||d.supplyDefaults(t),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(t,V,[t,a.undoit],V,[t,a.redoit]);var s=o.syncOrAsync(l,t);return s&&s.then||(s=Promise.resolve(t)),s.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function q(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=h.id2name(i),l=t.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(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(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=h.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(t,r,{skipTitle:n})}:function(t){return h.draw(t,"redraw")};t.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(t,e){var r,n,a,i=t.layout,s=t._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(e),g=h.list(t),v=o.extendDeepAll({},e),m={};for(U(e),p=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[I];)I--;var R=P.parts[I],F=P.parts[I-1]+"."+R,H=P.parts.slice(0,I).join("."),j=l(t.layout,H).get(),V=l(s,H).get(),q=P.get();if(void 0!==E){k[z]=E,L[z]="reverse"===R?E:N(q);var G=f.getLayoutValObject(s,P.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(z,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(z))if(E){S("autosize",null);var J="height"===z?"width":"height";S(J,s[J])}else s[z]=t._initialAutoSize[z];else if("autosize"===z)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))D(F),l(s,H+"._inputRange").set(null);else if(F.match(Y)){D(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){C=j;var K="linear"===V.type&&"log"===E,tt="log"===V.type&&"linear"===E;if(K||tt){if(C&&C.range)if(V.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];K?(et<=0&&rt<=0&&S(H+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(H+".range[0]",Math.log(et)/Math.LN10),S(H+".range[1]",Math.log(rt)/Math.LN10)):(S(H+".range[0]",Math.pow(10,et)),S(H+".range[1]",Math.pow(10,rt)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,E,S),u.getComponentMethod("images","convertCoords")(t,V,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var nt=l(s,z).get(),at=(E||{}).type;at&&"-"!==at||(at="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,at,S),u.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=w.containerArrayMatch(z);if(it){r=it.array,n=it.index;var ot=it.property,lt=G||{editType:"calc"};""!==n&&""===ot&&(w.isAddVal(E)?L[z]=null:w.isRemoveVal(E)?L[z]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(_,lt),m[r]||(m[r]={});var st=m[r][n];st||(st=m[r][n]={}),st[ot]=E,delete e[z]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===z&&("lasso"===E||"select"===E)&&"lasso"!==q&&"select"!==q||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,P.set(E))}}for(r in m){w.applyContainerArrayChanges(t,d(i,r),m[r],_,d)||(_.plot=!0)}for(var ct in O){var ut=(C=h.getFromId(t,ct))&&C._constraintGroup;if(ut)for(var ft in _.calc=!0,ut)O[ft]||(h.getFromId(t,ft)._constraintShrinkable=!0)}return(Q(t)||e.height||e.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:k,eventData:v}}function Q(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&d.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function J(t,e,n,a){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=T.coerceTraceIndices(t,a),l=j(t,o.extendFlat({},e),i),s=l.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(t.calcdata=void 0),s.clearAxisTypes&&T.clearAxisTypes(t,i,n);var p=[];f.layoutReplot?p.push(k.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),q(t,f,u)||d.supplyDefaults(t),s.style&&p.push(k.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(k.doColorBars),f.legend&&p.push(k.doLegend),f.layoutstyle&&p.push(k.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(k.doTicksRelayout),f.modebar&&p.push(k.doModeBar),f.camera&&p.push(k.doCamera),p.push(S)),p.push(d.rehover,d.redrag),c.add(t,J,[t,l.undoit,u.undoit,l.traces],J,[t,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,t);return h&&h.then||(h=Promise.resolve(t)),h.then((function(){return t.emit("plotly_update",{data:l.eventData,layout:u.eventData}),t}))}function $(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,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&&f()};e()}var h,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=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&kk)&&M.push(g);y=M}}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=(u[g]||h[g]||{}).name,m=e[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(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,l],p=[t,i];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,l,s=[],u=r.deleteTraces,f=t,d=[e,s],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 h(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,e,l)},r.getLayoutValObject=function(t,e){return b(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=e+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(t,e){o?n.nestedProperty(l[s],t).set(e):l[s+"."+t]=e}function f(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":233,"../plots/attributes":275}],269:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,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 x(t){var e,a,l,u,h,g,v=t._fullLayout,m=v._size,x=m.p,_=d.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(c.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 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:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:m.l+m.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 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,D=l.plotgroup;if(y(C,O,L)){var z=D.node(),P=l.bg=o.ensureSingle(D,"rect","bg");z.insertBefore(P.node(),z.childNodes[0]),A.push(a)}else D.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,U,V,q,G,Z,Y=v._bgLayer.selectAll(".bg").data(M);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(t){v._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)&&v(i)&&t(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":233,"../plots/attributes":275,"../plots/plots":313,"./plot_config":266,"./plot_schema":267,"./plot_template":268}],271:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=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,d,p,h;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],d=t.layout||{},p=t.config||{},h={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),d=o.extendDeep({},t.layout),p=t._context,h=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("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,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===e.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===e.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(t){setTimeout(t,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){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(),t(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return t(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(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(e){t(function(t){return T?t.replace(l.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":233,"../plots/plots":313,"../snapshot/helpers":330,"../snapshot/svgtoimg":332,"../snapshot/tosvg":334,"../version":494,"./plot_api":265,"fast-isnumeric":23}],272:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;dx.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,D=Array.isArray(k);if(D&&(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 z=x[A].length;for(M=0;M<(D?Math.min(z,k[A].length):z);M++)L=D?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&&Math.round(f)===f))return a;c=f}for(var d=e.calendar,p="start"===s,h="end"===s,g=t[r+"period0"],v=i(g,d)||0,m=[],y=a.length,x=0;xT;)w=o(w,-c,d);for(;w<=T;)w=o(w,c,d);_=o(w,-c,d)}else{for(w=v+(b=Math.round((T-v)/u))*u;w>T;)w-=u;for(;w<=T;)w+=u;_=w-u}m[x]=p?_:h?w:(_+w)/2}return m}},{"../../constants/numerical":212,"../../lib":233,"fast-isnumeric":23}],277:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],278:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry"),l=t("./axis_ids"),s=l.getFromId,c=l.isLinked;function u(t,e){var r,n,i=[],o=t._fullLayout,l=d(o,e,0),s=d(o,e,1),c=p(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return a.simpleMap(e.range,e.r2l);var g=u[0].val,v=h[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>C?k/T>O&&(_=x,w=b,O=k/T):k/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=k/S));if(g===v){var D=g-1,z=g+1;if(A)if(0===g)i=[0,1];else{var P=(g>0?h:u).reduce((function(t,e){return Math.max(t,s(e))}),0),E=g/(1-Math.min(.5,P/S));i=g>0?[0,E]:[E,0]}else i=L?[Math.max(0,D),Math.max(1,z)]:[D,z]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-O*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-f(e,x.val,b.val))/(S-l(_)-s(w)),i=[_.val-O*l(_),w.val+O*s(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(a=0;a0&&(d=o),o>p&&o-i&&(d=o),o>p&&o=z;a--)D(a);return{min:v,max:y,opts:r}},concatExtremes:p};function p(t,e,r){var n,a,i,o=e._id,l=t._fullData,c=t._fullLayout,u=[],f=[];function d(t,e){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(s,1),s--)}if(l){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function m(t){return n(t)&&Math.abs(t)=e}},{"../../constants/numerical":212,"../../lib":233,"../../registry":326,"./axis_ids":282,"fast-isnumeric":23}],279:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=l.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("./layout_attributes"),h=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,x=g.ONEMAXQUARTER,b=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,T=g.ONEAVGMONTH,k=g.ONEMINMONTH,M=g.ONEWEEK,A=g.ONEDAY,L=A/2,S=g.ONEHOUR,C=g.ONEMIN,O=g.ONESEC,D=g.MINUS_SIGN,z=g.BADNUM,P=t("../../constants/alignment"),E=P.MID_SHIFT,I=P.CAP_SHIFT,R=P.LINE_SPACING,F=P.OPPOSITE_SIDE,N=e.exports={};N.setConvert=t("./set_convert");var B=t("./axis_autotype"),H=t("./axis_ids"),j=H.idSort,U=H.isLinked;N.id2name=H.id2name,N.name2id=H.name2id,N.cleanId=H.cleanId,N.list=H.list,N.listIds=H.listIds,N.getFromId=H.getFromId,N.getFromTrace=H.getFromTrace;var V=t("./autorange");N.getAutoRange=V.getAutoRange,N.findExtremes=V.findExtremes;function q(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}N.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(t,e,u,c)},N.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},N.coercePosition=function(t,e,r,n,a,i){var o,s;if("range"!==N.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=N.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},N.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:N.getFromId(e,r).cleanPos)(t)},N.redrawComponents=function(t,e){e=e||N.listIds(t);var r=t._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*A:t-=L;var s=N.tickIncrement(t,r);if(s<=n)return s}return t}(y,t,m,c,i)),v=y,0;v<=u;)v=N.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:u-c}},N.prepTicks=function(t,e){var r=l.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"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=l.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])/i,N.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=N.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:p<=o;p=N.tickIncrement(p,t.dtick,s,t.calendar)){if(t.rangebreaks&&!s){if(p=u)break}if(C.length>g||p===O)break;O=p;var D=!1;f&&p!==(0|p)&&(D=!0),C.push({minor:D,value:p})}if(d&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=t[i].value,c=t[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=k?d=u>=k&&u<=w?u:T:r===M&&f>=M?d=M:f>=A?d=A:r===L&&f>=L?d=L:r===S&&f>=S&&(d=S),d>=u&&(d=u,l=!0);var p=a+d;if(e.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;e.maskBreaks(a*(1-C)+C*p)!==z&&h++}(d*=h/84)||(t[n].drop=!0),l&&u>M&&(d=u)}(d>0||0===n)&&(t[n].periodX=a+d/2)}}(C,t,t._definedDelta),t.rangebreaks){var P="y"===t._id.charAt(0),E=1;"auto"===t.tickmode&&(E=t.tickfont?t.tickfont.size:12);var I=NaN;for(h=C.length-1;h>-1;h--)if(C[h].drop)C.splice(h,1);else{C[h].value=wt(C[h].value,t);var R=t.c2p(C[h].value);(P?I>R-E:Iu||Bu&&(F.periodX=u),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&i<=10||e>=15*A)t._tickround="d";else if(e>=C&&i<=16||e>=S)t._tickround="M";else if(e>=O&&i<=19||e>=C)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ot(t.exponentformat)&&!lt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function at(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}}N.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*rt(e,r,W);else if(i>T)e/=T,t.dtick="M"+rt(e,1,Q);else if(i>A){t.dtick=rt(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:$);var o=N.getTickFormat(t),s="period"===t.ticklabelmode;s&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=l.dateTick0(t.calendar,2):t.tick0=l.dateTick0(t.calendar,1),s&&(t._dowTick0=t.tick0)}else i>S?t.dtick=rt(e,S,Q):i>C?t.dtick=rt(e,C,J):i>O?t.dtick=rt(e,O,J):(r=n(10),t.dtick=rt(e,r,W))}else if("log"===t.type){t.tick0=0;var c=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+rt(e,r,W)}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))):_t(t)?(t.tick0=0,r=1,t.dtick=rt(e,r,et)):(t.tick0=0,r=n(10),t.dtick=rt(e,r,W));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},N.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return l.increment(t,o*e);var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?tt:K,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t,e){var r=t.r2l||Number,i=l.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=s,c+="
"+s;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=st(Math.pow(10,s),t,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=t.exponentformat;"power"===p||ot(p)&<(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":D)+d+"",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(f>0?"+":D)+d:(e.text=st(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,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):_t(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=st(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=st(l.deg2rad(e.x),t,a,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=D+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=st(e.x,t,a,n)}(t,o,0,c,g),n||(t.tickprefix&&!h(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!h(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},N.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return N.hoverLabelText(t,e)+" - "+N.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=N.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":D+a:a};var it=["f","p","n","\u03bc","m","","k","M","G","T"];function ot(t){return"SI"===t||"B"===t}function lt(t){return t>14||t<-15}function st(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=N.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};nt(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,D);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))"+p+"":"B"===s&&9===c?t+="B":ot(s)&&(t+=it[c/3+5]));return i?D+t:t}function ct(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-f:0,d)))),e.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]=e._depth:(n[s]=e._depth=Math.max(r.width>0?f-r.top:0,d),p.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"===s?n[s]=e._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=e._depth=Math.max(r.height>0?r.right-f:0,d),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!==c._dfltTitle[h]&&(n[s]+=dt(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]+=d),!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]]))}J&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,gt(e),n),i.autoMargin(t,vt(e),a),i.autoMargin(t,mt(e),l)})),r.skipTitle||J&&"bottom"===e.side||W.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+dt(e);else{var l=-1!==(e.ticklabelposition||"").indexOf("inside");if("multicategory"===e.type)r=e._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===e.ticks&&(s+=e.ticklen)),r=10+s+(e.linewidth?e.linewidth-1:0)}l||(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 c,f,p,h,g=N.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,p="top"===e.side?g-r:g+r):(p=e._offset+e._length/2,f="right"===e.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(h={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.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:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),l.syncOrAsync(W)}}function $(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=ht(this),e=d.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]}},N.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},N.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},N.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=t.side,u=s?(t.tickwidth||0)/2:0,f=3,d=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=d*I,f+=(t.linewidth||0)/2);(a||i)&&(u+=(t.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-I));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return s(r+t._offset+t.l2p(ut(e)),n)}:function(e){return s(n,r+t._offset+t.l2p(ut(e)))}},N.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},N.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,h=0,g=d?t.ticklen:0;if(f?g*=-1:u&&(g=0),d&&(p+=g,r)){var v=l.deg2rad(r);p=g*Math.cos(v)+1,h=g*Math.sin(v)}t.showticklabels&&(d||t.showline)&&(p+=.2*t.tickfont.size);var m,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),m=h*b,y=e+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=E:x=-90===A&&"bottom"===k?I:90===A&&"top"===k?E:.5,T=E/2*(A/90)),w.xFn=function(t){return t.dx+m+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(s)return"end";if(c)return"start"}return a(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===M){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),m=p,y=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?I:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*I*b,x=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*E},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},N.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],ft);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",d.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},N.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&&N.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,l=0;lo||a.lefto||a.top+(e.tickangle?0:t.fontSize/4)1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=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]))&&(e.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(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=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[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(e.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":326,"./constants":285}],283:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=e.categoryorder="trace"),"trace"===s?e._initialCategories=[]:"array"===s?e._initialCategories=l.slice():(l=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;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;oc*x)||T)for(r=0;rP&&FD&&(D=F);d/=(D-O)/(2*z),O=s.l2r(O),D=s.l2r(D),s.range=s._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(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",s(r,n)).attr("d",a+"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",s(e,r)).attr("d","M0,0Z")}function H(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){D&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),D=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,O)/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,a){for(var i,o,s,c,u=!1,f={},d={},p=(a||{}).xaHash,h=(a||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(U(a),2!==t||vt||Vt(),gt)i.indexOf("select")>-1&&A(r,a,W,Q,e.id,Ot),i.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&vt){var l=h?z:D,s="s"===h||"w"===v?0:1,u=l._name+".range["+s+"]",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))}(l,s),p="left",g="middle";if(l.fixedrange)return;h?(g="n"===h?"top":"bottom","right"===l.side&&(p="right")):"e"===v&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=l.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(K,dt*e+bt)),a=Math.max(0,Math.min(tt,pt*r+_t)),i=Math.abs(n-bt),o=Math.abs(a-_t);function l(){At="",wt.r=wt.l,wt.t=wt.b,St.attr("d","M0,0Z")}if(wt.l=Math.min(bt,n),wt.r=Math.max(bt,n),wt.t=Math.min(_t,a),wt.b=Math.max(_t,a),et.isSubplotConstrained)i>O||o>O?(At="xy",i/K>o/tt?(o=i*tt/K,_t>a?wt.t=_t-o:wt.b=_t+o):(i=o*K/tt,bt>n?wt.l=bt-i:wt.r=bt+i),St.attr("d",q(wt))):l();else if(rt.isSubplotConstrained)if(i>O||o>O){At="xy";var s=Math.min(wt.l/K,(tt-wt.b)/tt),c=Math.max(wt.r/K,(tt-wt.t)/tt);wt.l=s*K,wt.r=c*K,wt.b=(1-s)*tt,wt.t=(1-c)*tt,St.attr("d",q(wt))}else l();else!at||o0){var u;if(rt.isSubplotConstrained||!nt&&1===at.length){for(u=0;ug[1]-1/4096&&(e.domain=l),a.noneOrAll(t.domain,e.domain,l)}return r("layer"),e}},{"../../lib":233,"fast-isnumeric":23}],297:[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)],t.setScale()}},{"../../constants/alignment":207}],298:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),l=t("../../components/fx"),s=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.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"),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"),M=k.MINSELECT,A=x.filter,L=x.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),O=C.p2r,D=C.axValue,z=C.getTransform;function P(t,e,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,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}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(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,l=[],s=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 j(t,e,r){var n,i,o,l;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=E.clickmode;b.done(gt).then((function(){if(b.clear(gt),2===t){for(ft.remove(),K=0;K-1&&P(e,C,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&C.emit("plotly_selected",void 0);l.click(C,e)})).catch(y.error)}},a.doneFn=function(){ht.remove(),b.done(gt).then((function(){b.clear(gt),a.gd.emit("plotly_selected",et),$&&a.selectionDefs&&($.subtract=ut,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,J)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:P}},{"../../components/color":105,"../../components/dragelement/helpers":123,"../../components/drawing":127,"../../components/fx":145,"../../components/fx/helpers":141,"../../components/shapes/draw_newshape/display_outlines":190,"../../components/shapes/draw_newshape/helpers":191,"../../components/shapes/draw_newshape/newshapes":192,"../../lib":233,"../../lib/clear_gl_canvases":221,"../../lib/polygon":245,"../../lib/throttle":256,"../../plot_api/subroutines":269,"../../registry":326,"./axis_ids":282,"./constants":285,"./handle_outline":289,"./helpers":290,polybooljs:79}],299:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../../lib"),l=o.cleanNumber,s=o.ms2DateTime,c=o.dateTime2ms,u=o.ensureNumber,f=o.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,h=d.BADNUM,g=d.LOG_CLIP,v=d.ONEWEEK,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=t("./axis_ids"),w=t("./constants"),T=w.HOUR_PATTERN,k=w.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",d=r.charAt(0);function L(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*g*Math.abs(n-a))}return h}function S(e,r,n,a){if((a||{}).msUTC&&i(e))return+e;var l=c(e,n||t.calendar);if(l===h){if(!i(e))return h;e=+e;var s=Math.floor(10*o.mod(e+.05,1)),u=Math.round(e-s/10);l=c(new Date(u))+s/10}return l}function C(e,r,n){return s(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function D(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 h}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=z(t);return void 0!==e?e:i(t)?+t:void 0}function E(t){return i(t)?+t:z(t)}function I(t,e,r){return n.round(r+e*t,2)}function R(t,e,r){return(t-r)/e}var F=function(e){return i(e)?I(e,t._m,t._b):h},N=function(e){return R(e,t._m,t._b)};if(t.rangebreaks){var B="y"===d;F=function(e){if(!i(e))return h;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=B;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,l=0,s=0;su)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=t._B[l]||0;return isFinite(f)?I(e,t._m2,f):0},N=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?L:u,t.l2c="log"===t.type?M:u,t.l2p=F,t.p2l=N,t.c2p="log"===t.type?function(t,e){return F(L(t,e))}:F,t.p2c="log"===t.type?function(t){return M(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return L(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=L,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=S,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(S(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,h,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=E(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=E,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=O,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=z,t.l2r=t.c2r=u,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var a,i,l=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var c in s)if(c!==r){var u=e[_.id2name(c)];l=l.concat(u._traceIndices)}var p=[[0,{}],[0,{}]],h=[];for(a=0;ap&&(l[n]=p),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else o.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=_.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var l,s,c=t.r2l(t[i][0],o),u=t.r2l(t[i][1],o),f="y"===d;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(l=0;lu&&(p=!p),p&&t._rangebreaks.reverse();var h=p?-1:1;for(t._m2=h*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),l=0;la&&(a+=7,ia&&(a+=24,i=n&&i=n&&e=l.min&&(tl.max&&(l.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 v(e,r){var n=e.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!e.xr1,d=!!e.yr1,p=[];if(f){var h=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.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(e.yr0,s.r2l),x=i.simpleMap(e.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(t,a,{skipTitle:!0}),l.drawOne(t,s,{skipTitle:!0}),l.redrawComponents(t,[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(t)}},{"../../components/drawing":127,"../../lib":233,"../../registry":326,"./axes":279,d3:21}],304:[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,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,l=t._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);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,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(t.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(d.autotypenumbers=t.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,e,l,n+1):e(l,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){i(t,c,l.cache),l.check=function(){if(s){var e=i(t,c,l.cache);return e.changed&&o&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=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"),l=r.select(".js-link-spacer"),s=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(){x.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),l.text(o.text()&&s.text()?" - ":"")}},x.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=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&E.length>1){for(o.getComponentMethod("grid","sizeDefaults")(u,s),l=0;l15&&E.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"),x.linkSubplots(d,s,f,i),x.cleanPlot(d,s,f,i);var B=!(!i._has||!i._has("gl2d")),H=!(!s._has||!s._has("gl2d")),j=!(!i._has||!i._has("cartesian"))||B,U=!(!s._has||!s._has("cartesian"))||H;j&&!U?i._bgLayer.remove():U&&!j&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&p({_fullLayout:i}),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*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,l,s=o.componentsRegistry,u=e._basePlotModules,f=o.subplotsRegistry.cartesian;for(a in s)(l=s[a]).includeBasePlot&&l.includeBasePlot(t,e);for(var d in u.length||u.push(f),e._has("cartesian")&&(o.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:m,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:b,size:r.t+h}},p[e]=1}else delete d[e],delete p[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var a=e._size,l=e.margin,s=c.extendFlat({},a),u=l.l,f=l.r,p=l.t,h=l.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:h}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,T=b.size,k=_.val,M=_.size;for(var A in g){if(i(T)&&g[A].r){var L=g[A].r.val,S=g[A].r.size;if(L>w){var O=(T*L+(S-r)*w)/(L-w),D=(S*(1-w)+(T-r)*(1-L))/(L-w);O+D>u+f&&(u=O,f=D)}}if(i(M)&&g[A].t){var z=g[A].t.val,P=g[A].t.size;if(z>k){var E=(M*z+(P-n)*k)/(z-k),I=(P*(1-k)+(M-n)*(1-z))/(z-k);E+I>h+p&&(h=E,p=I)}}}}}var R=c.constrain(r-l.l-l.r,2,64),F=c.constrain(n-l.t-l.b,2,64),N=Math.max(0,r-R),B=Math.max(0,n-F);if(N){var H=(u+f)/N;H>1&&(u/=H,f/=H)}if(B){var j=(h+p)/B;j>1&&(h/=j,p/=j)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(p),a.b=Math.round(h),a.p=Math.round(l.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return o.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,l=0;function s(){return i++,function(){l++,n||l!==i||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 o.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(s),setTimeout(s())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.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&&!c.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)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),s&&(f.frames=u(s)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[e]=o}}for(P(s,u,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 D=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),C[2]||(C[2]=D);var z=n.range.apply(this,C);if(z=z.map((function(t,e){return parseFloat(t.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(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(E)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=t.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(t,e){return" "+t+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=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: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=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var 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]),t.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var U=t.select("g.title-group text").style(N).text(d.title.text),V=U.node().getBBox();U.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var q=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=q.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()}q.select("circle.outside-circle").attr({r:x}).style(F);var Z=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text((function(t,e){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(d.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(d.minorTicks+1)==0)})).style(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(t,e){var r=Y(t),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(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));I.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.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"),lt=t.select(".tooltips-group"),st=o.tooltipPanel().config({container:lt,fontSize:8})(),ct=o.tooltipPanel().config({container:lt,fontSize:8})(),ut=o.tooltipPanel().config({container:lt,hasTick:!0})();if(!k){var ft=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(Z).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);st.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 dt=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(Z).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,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(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ut.config({color:l}).text(u),ut.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(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},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],o.Axis.defaultConfig().data[0]),a(s.data[e],t)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return t},n.rebind(d,f,"on"),d},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 l={t:i,r:o};return r&&(l.name=r),l},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 s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return h.stroke(r,a,i)},"stroke-width":function(t,e){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](r,a,i)},opacity:function(t,e){return h.opacity(r,a,i)},display:function(t,e){return h.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(t){return-d/2})).endAngle((function(t){return d/2})).innerRadius((function(t){return e.radialScale(s+(t[2]||0))})).outerRadius((function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])}));c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={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(h).each(c[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 l=e.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(t,e){return t.color})),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.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(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.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,v(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(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return 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},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(t=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"}),e=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||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=e.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),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(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 l=a({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(t,e){u[c[s.indexOf(t.key)]]=t.value})),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return t}},{"../../../constants/alignment":207,"../../../lib":233,d3:21}],318:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,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(),e=e?s(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 d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},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 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)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},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=s(o,t.layout)}},{"../../../components/color":105,"../../../lib":233,"./micropolar":317,"./undo_manager":319,d3:21}],319:[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=u&&(p.min=0,g.min=0,v.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function h(t,e,r,n){var a=f[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=e._name.charAt(0).toUpperCase(),g="Component "+h,v=o("title.text",g);e._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(t,e,o,"linear"),l(t,e,o,"linear",{}),s(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:d,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:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":105,"../../lib":233,"../../plot_api/plot_template":268,"../cartesian/line_grid_defaults":295,"../cartesian/tick_label_defaults":300,"../cartesian/tick_mark_defaults":301,"../cartesian/tick_value_defaults":302,"../subplot_defaults":320,"./layout_attributes":323}],325:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),l=o.strTranslate,s=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),h=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),m=t("../../components/dragelement/helpers"),y=m.freeMode,x=m.rectMode,b=t("../../components/titles"),_=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,M=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 L=A.prototype;L.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},L.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*b?a=(i=b)*S:i=(a=x)/S,o=m*a/x,s=y*i/b,r=e.l+e.w*g-a/2,n=e.t+e.h*(1-v)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[g-o/2,g+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-k],domain:[v-s/2,v+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],A=p.aaxis=d({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var C=p.caxis=d({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+s*S],anchor:"free",position:0,_id:"y",_length:a});f(C,p.graphDiv._fullLayout),C.setScale();var O="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",O),p.layers.plotbg.select("path").attr("d",O);var D="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",D);var z=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),p.clipDefRelative.select("path").attr("transform",null);var P=l(r-L._offset,n+i);p.layers.baxis.attr("transform",P),p.layers.bgrid.attr("transform",P);var E=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",E),p.layers.agrid.attr("transform",E);var I=l(r+a/2,n)+"rotate(-30)"+l(0,-C._offset);p.layers.caxis.attr("transform",I),p.layers.cgrid.attr("transform",I),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.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"]=b.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"]=b.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"]=b.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"}})}},L.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,l=this.layers[n],s=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),t.setScale();var u=h.calcTicks(t),f=h.clipEnds(t,u),d=h.makeTransTickFn(t),p=h.getTickSigns(t)[2],g=o.deg2rad(30),v=p*(t.linewidth||1)/2,m=p*t.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];h.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,t,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,t,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(t,0,30)})};var C=M.MINZOOM/2+.87,O="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",D="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",z="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",P=!0;function E(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var t,e,r,n,f,d,p,h,m,b,T,k,A=this,L=A.layers.plotbg.select("path").node(),C=A.graphDiv,I=C._fullLayout._zoomlayer;function R(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;E(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&v.click(C,e,A.id)}function N(t,e){return 1-e/A.h}function B(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function H(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function j(a,i){var o=r+a*t,l=n+i*e,s=Math.max(0,Math.min(1,N(0,n),N(0,l))),c=Math.max(0,Math.min(1,B(r,n),B(o,l))),u=Math.max(0,Math.min(1,H(r,n),H(o,l))),g=(s/2+u)*A.w,v=(1-s/2-c)*A.w,y=(g+v)/2,x=v-g,_=(1-s)*A.h,w=_-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),C.emit("plotly_relayouting",R(p))}function U(){E(C),p!==f&&(i.call("_guiRelayout",C,R(p)),P&&C.data&&C._context.showTips&&(o.notifier(s(C,"Double-click to zoom back out"),"long"),P=!1))}function V(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,a=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),i=a.indexOf(p.a),s=a.indexOf(p.b),c=a.indexOf(p.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),p={a:a[i],b:a[s],c:a[c]},e=(f.a-p.a)*A.yaxis._m,t=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-t,-e);A.clipDefRelative.select("path").attr("transform",h),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),C.emit("plotly_relayouting",R(p))}function q(){i.call("_guiRelayout",C,R(p))}this.dragOptions={element:L,gd:C,plotinfo:{id:A.id,domain:C._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var g=A.dragOptions.dragmode=C._fullLayout.dragmode;y(g)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===g?(A.dragOptions.moveFn=j,A.dragOptions.clickFn=F,A.dragOptions.doneFn=U,function(t,e,i){var s=L.getBoundingClientRect();r=e-s.left,n=i-s.top,C._fullLayout._calcInverseTransform(C);var u=C._fullLayout._invTransform,g=o.apply3DTransform(u)(r,n);r=g[0],n=g[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,d=A.aaxis.range[1]-f.a,h=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),m="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=I.append("path").attr("class","zoombox").attr("transform",l(A.x0,A.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",m),k=I.append("path").attr("class","zoombox-corners").attr("transform",l(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(C)}(0,s,u)):"pan"===g?(A.dragOptions.moveFn=V,A.dragOptions.clickFn=F,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearSelect(C)):(x(g)||y(g))&&_(i,s,u,A.dragOptions,g)}},L.onmousemove=function(t){v.hover(C,t,A.id),C._fullLayout._lasthover=L,C._fullLayout._hoversubplot=A.id},L.onmouseout=function(t){C._dragging||g.unhover(C,t)},g.init(this.dragOptions)}},{"../../components/color":105,"../../components/dragelement":124,"../../components/dragelement/helpers":123,"../../components/drawing":127,"../../components/fx":145,"../../components/titles":200,"../../lib":233,"../../lib/extend":227,"../../registry":326,"../cartesian/axes":279,"../cartesian/constants":285,"../cartesian/select":298,"../cartesian/set_convert":299,"../plots":313,d3:21,tinycolor2:88}],326:[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"),l=t("./lib/dom").addStyleRule,s=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=s.extendFlat,d=s.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 m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},s=0;s-1&&(f[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":105,"../components/drawing":127,"../constants/xmlns_namespaces":213,"../lib":233,d3:21}],335:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+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"===v.orientation?(i=r,l=e,u="y",f="x",d=L,p=A):(i=e,l=r,u="x",f="y",p=L,d=A);var S=t[u+"a"],C=t[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(t){return(d(t)+p(t))/2}));if(n.getClosest(g,O,t),!1!==t.index&&g[t.index].p!==c){y||(T=function(t){return Math.min(_(t),t.p-m.bargroupwidth/2)},k=function(t){return Math.max(w(t),t.p+m.bargroupwidth/2)});var D=g[t.index],z=v.base?D.b+D.s:D.s;t[f+"0"]=t[f+"1"]=C.c2p(D[f],!0),t[f+"LabelVal"]=z;var P=m.extents[m.extents.round(D.p)];t[u+"0"]=S.c2p(y?T(D):P[0],!0),t[u+"1"]=S.c2p(y?k(D):P[1],!0);var E=void 0!==D.orig_p;return t[u+"LabelVal"]=E?D.orig_p:D.p,t.labelLabel=s(S,t[u+"LabelVal"]),t.valueLabel=s(C,t[f+"LabelVal"]),t.baseLabel=s(C,D.b),t.spikeDistance=(L(D)+function(t){return M(_(t),w(t))}(D))/2-b,t[u+"Spike"]=S.c2p(D.p,!0),o(D,v,t),t.hovertemplate=v.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=l(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,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":105,"../../components/fx":145,"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"./helpers":342}],344:[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":292,"../scatter/marker_colorbar":465,"./arrays_to_calcdata":335,"./attributes":336,"./calc":337,"./cross_trace_calc":339,"./defaults":340,"./event_data":341,"./hover":343,"./layout_attributes":345,"./layout_defaults":346,"./plot":347,"./select":348,"./style":350}],345:[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"}}},{}],346:[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 l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(t){return"auto"===t?0:t}function S(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,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(e-t),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?q:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?q(t):t>e?Math.ceil(t):Math.floor(t)};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(z,"path"),D,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))||U&&t._context.staticPlot?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,e.layerClipId,t),!D.uniformtext.mode&&R){var Y=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,Y,t)}!function(t,e,r,n,a,l,c,f,p,v,m){var w,T=e.xaxis,A=e.yaxis,O=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,t)}var z=n[0].trace,P="h"===z.orientation,E=function(t,e,r,n,a){var o,l=e[0].trace;o=l.texttemplate?function(t,e,r,n,a){var o=e[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(t){return u(d,+t,!0).text}var v=e[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,t._d3locale,_,m,o._meta||{})}(t,e,r,n,a):l.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(t){return u(o?r:n,+t,!0).text}var f,d=a.textinfo,p=t[e],h=d.split("+"),g=[],v=function(t){return-1!==h.indexOf(t)};v("label")&&g.push((m=t[e].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("
")}(e,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(z,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],z),H=h.getInsideTextFont(z,a,N,B),j=h.getOutsideTextFont(z,a,N),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]=G*(W/Z):W>=Z*(X/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Y=i.ensureUniformFontSize(t,"outside"===w?j:H);var K=(V=D(r,E,Y)).attr("transform");if(V.attr("transform",""),q=s.bBox(V.node()),G=q.width,Z=q.height,V.attr("transform",K),G<=0||Z<=0)return void V.remove()}var tt,et,rt=z.textangle;"outside"===w?(et="both"===z.constraintext||"outside"===z.constraintext,tt=function(t,e,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(e-t),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=(t+e)/2,w=(r+n)/2,T=0,M=0,A=l?k(e,t):k(r,n);l?(b=e-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,q,{isHorizontal:P,constrained:et,angle:rt})):(et="both"===z.constraintext||"inside"===z.constraintext,tt=C(l,c,f,p,q,{isHorizontal:P,constrained:et,angle:rt,anchor:z.insidetextanchor}));tt.fontSize=Y.size,d(z.type,tt,O),R.transform=tt,M(V,O,v,m).attr("transform",i.getTextTransform(tt))}(t,e,z,r,p,N,B,H,j,v,m),e.layerClipId&&s.hideOutsideRangePoint(c,z.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,z,e,v)},toMoveInsideBar:C}},{"../../components/color":105,"../../components/drawing":127,"../../components/fx/helpers":141,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":326,"./attributes":336,"./constants":338,"./helpers":342,"./style":350,"./uniform_text":352,d3:21,"fast-isnumeric":23}],348:[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),l=r.c2p(n?t.p0:t.s0,!0),s=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.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){h(n.select(this),e[0].trace,t)})),l.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,l=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,v(l,t,e,r));var s=e.selected.textfont&&e.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(h(r,a,t),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":105,"../../components/drawing":127,"../../lib":233,"../../registry":326,"./attributes":336,"./helpers":342,"./uniform_text":352,d3:21}],351:[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,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":105,"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116}],352:[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=oS.uf};if(e._hasPreCompStats){var j=e[x],U=function(t){return y.d2c((e[t]||[])[r])},V=1/0,q=-1/0;for(r=0;r=S.q1&&S.q3>=S.med){var Z=U("lowerfence");S.lf=Z!==l&&Z<=S.q1?Z:p(S,O,D);var Y=U("upperfence");S.uf=Y!==l&&Y>=S.q3?Y:h(S,O,D);var X=U("mean");S.mean=X!==l?X:D?o.mean(O,D):(S.q1+S.q3)/2;var W=U("sd");S.sd=X!==l&&W>=0?W:D?o.stdev(O,D,S.mean):S.q3-S.q1,S.lo=g(S),S.uo=v(S);var Q=U("notchspan");Q=Q!==l&&Q>0?Q:m(S,D),S.ln=S.med-Q,S.un=S.med+Q;var J=S.lf,$=S.uf;e.boxpoints&&O.length&&(J=Math.min(J,O[0]),$=Math.max($,O[D-1])),e.notched&&(J=Math.min(J,S.ln),$=Math.max($,S.un)),S.min=J,S.max=$}else{var K;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),K=S.med!==l?S.med:S.q1!==l?S.q3!==l?(S.q1+S.q3)/2:S.q1:S.q3!==l?S.q3:0,S.med=K,S.q1=S.q3=K,S.lf=S.uf=K,S.mean=S.sd=K,S.ln=S.un=K,S.min=S.max=K}V=Math.min(V,S.min),q=Math.max(q,S.max),S.pts2=C.filter(H),A.push(S)}}e._extremes[y._id]=a.findExtremes(y,[V,q],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a=0&&at0){var ut,ft;if((S={}).pos=S[_]=N[r],C=S.pts=nt[r].sort(f),D=(O=S[x]=C.map(d)).length,S.min=O[0],S.max=O[D-1],S.mean=o.mean(O,D),S.sd=o.stdev(O,D,S.mean),S.med=o.interp(O,.5),D%2&&(st||ct))st?(ut=O.slice(0,D/2),ft=O.slice(D/2+1)):ct&&(ut=O.slice(0,D/2+1),ft=O.slice(D/2)),S.q1=o.interp(ut,.5),S.q3=o.interp(ft,.5);else S.q1=o.interp(O,.25),S.q3=o.interp(O,.75);S.lf=p(S,O,D),S.uf=h(S,O,D),S.lo=g(S),S.uo=v(S);var dt=m(S,D);S.ln=S.med-dt,S.un=S.med+dt,it=Math.min(it,S.ln),ot=Math.max(ot,S.un),S.pts2=C.filter(H),A.push(S)}e._extremes[y._id]=a.findExtremes(y,e.notched?tt.concat([it,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(A[0].t={num:T[L],dPos:B,posLetter:_,valLetter:x,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:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function f(t,e){return t.v-e.v}function d(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function h(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function g(t){return 4*t.q1-3*t.q3}function v(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":212,"../../lib":233,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"fast-isnumeric":23}],355:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(t,e,r,o){var l,s,c,u=e.calcdata,f=e._fullLayout,d=o._id,p=d.charAt(0),h=[],g=0;for(l=0;l1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(l=0;l0){var q=S.pointpos,G=S.jitter,Z=S.marker.size/2,Y=0;q+G>=0&&((Y=U*(q+G))>A?(V=!0,H=Z,N=Y):Y>R&&(H=Z,N=A)),Y<=A&&(N=A);var X=0;q-G<=0&&((X=-U*(q-G))>L?(V=!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;s0?(v="v",m=x>0?Math.min(_,b):Math.min(b)):x>0?(v="h",m=Math.min(_)):m=0;if(m){e._length=m;var L=r("orientation",v);e._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===y&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i)}else e.visible=!1}function f(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";e._hasPreCompStats?s="all":(o||l)&&(s="suspectedoutliers");var u=r(i+"points",s);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 f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function l(r,a){return n.coerce(t,e,c,r,a)}if(u(t,e,l,a),!1!==e.visible){o(t,e,a,l);var s=e._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(t.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(e.line.color,.5));var d=!1;if(s){var p=l("mean"),h=l("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}l("boxmean",d),l("whiskerwidth"),l("width"),l("quartilemethod");var g=!1;if(s){var v=l("notchspan");v&&v.length&&(g=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(g=!0);l("notched",g)&&l("notchwidth"),f(t,e,l,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(t,e,r,i){var o,l,s=e.val,c=e.pos,u=!!c.rangebreaks,f=i.bPos,d=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(t){var e=c.c2l(t.pos+f,!0),a=c.l2p(e-o)+d,i=c.l2p(e+l)+d,h=u?(a+i)/2:c.l2p(e)+d,g=s.c2p(t.mean,!0),v=s.c2p(t.mean-t.sd,!0),m=s.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+g+","+a+"V"+i+("sd"===p?"m0,0L"+v+","+h+"L"+g+","+a+"L"+m+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+g+"H"+i+("sd"===p?"m0,0L"+h+","+v+"L"+a+","+g+"L"+h+","+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],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(e=u,r=c):(e=c,r=u),o(a,{pos:e,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:e,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":127,"../../lib":233,d3:21}],363:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,l=[];if(!1===e)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)}}}},{}],368:[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,l=e.line,s=o.size||1,c=o.coloring,u=a(e,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(e);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":117,"./end_plus":376,"./make_color_map":381}],369:[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}}},{}],370:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,l=i.opacity,s=t("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;e.exports=function(t,e,r,i,s,f){var d,p,h,g=e.contours,v=r("contours.operation");(g._operation=c[v],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),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((t.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(e.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":105,"../../constants/filter_ops":210,"./label_defaults":380,"fast-isnumeric":23}],371:[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 l(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":210,"fast-isnumeric":23}],372:[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,l=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],373:[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,l=function(t){return t.reverse()},s=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 s}},{"../../lib":233,"./constraint_mapping":371,"./end_plus":376}],376:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],377:[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]}(f,r,e),p=[l(t,e,[-d[0],-d[1]])],h=t.z.length,g=t.z[0].length,v=e.slice(),m=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[f]):delete t.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(l(t,e,d)),e[0]+=d[0],e[1]+=d[1],u=e.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var y=d[0]&&(e[0]<0||e[0]>g-2)||d[1]&&(e[1]<0||e[1]>h-2);if(e[0]===v[0]&&e[1]===v[1]&&d[0]===m[0]&&d[1]===m[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,L,S,C,O,D,z,P,E=i(p[0],p[p.length-1],o,s),I=0,R=.2*t.smoothing,F=[],N=0;for(c=1;c=N;c--)if((x=F[c])=N&&x+F[b]A&&L--,t.edgepaths[L]=C.concat(p,S));break}U||(t.edgepaths[A]=p.concat(S))}for(A=0;At?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,l,s,c,u,f,d=t[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===t.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(t,e,r,n){var a=e.fontSize,i=e.width+a/3,o=Math.max(0,e.height-a/3),l=t.x,s=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),d=function(t,e){return[l+t*f-e*u,s+t*u+e*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:e.text,x:l,y:s,dy:e.dy,theta:c,level:e.level,width:i,height:o}),n.push(p)},r.drawLabels=function(t,e,r,i,o){var s=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(s.exit().remove(),s.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(l.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,f=r.end,d=t._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,t.ncontours).dtick,d.size=r.size=c}}},{"../../lib":233,"../../plots/cartesian/axes":279}],385:[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,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;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(t.level):l.color,l.dash)}));var h=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(t.level):l.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),p(t.level+.5*s)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*s))}})),i(t)}},{"../../components/drawing":127,"../heatmap/style":399,"./make_color_map":381,d3:21}],386:[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 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!==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":115,"./label_defaults":380}],387:[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"),l=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.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"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{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":112,"../../constants/docs":209,"../../lib/extend":227,"../../plots/attributes":275,"../../plots/template_attributes":321,"../scatter/attributes":447}],388:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),l=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array"),h=t("../../constants/numerical").BADNUM;function g(t){for(var e=[],r=t.length,n=0;nI){P("x scale is not linear");break}}if(x.length&&"fast"===D){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){P("y scale is not linear");break}}}var N=a.maxRowLength(T),B="scaled"===e.xtype?"":r,H=p(e,B,v,m,N,A),j="scaled"===e.ytype?"":x,U=p(e,j,b,_,T.length,L);O||(e._extremes[A._id]=i.findExtremes(A,H),e._extremes[L._id]=i.findExtremes(L,U));var V={x:H,y:U,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(V.orig_x=y),e.yperiodalignment&&w&&(V.orig_y=w),B&&B.length===H.length-1&&(V.xCenter=B),j&&j.length===U.length-1&&(V.yCenter=j),C&&(V.xRanges=M.xRanges,V.yRanges=M.yRanges,V.pts=M.pts),S||s(t,e,{vals:T,cLetter:"z"}),S&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=p(q,B,v,m,N,A),V.yfill=p(q,j,b,_,T.length,L)}return[V]}},{"../../components/colorscale/calc":113,"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"../../registry":326,"../histogram2d/calc":416,"./clean_2d_array":389,"./convert_column_xyz":391,"./find_empties":393,"./interp2d":396,"./make_bound_array":397}],389:[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 l,s,c,u,f,d;function p(t){if(n(t))return+t}if(e&&e.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(t,e){return e[2]-t[2]}))}},{"../../lib":233}],394:[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,l,s,c){var u,f,d,p,h=t.cd[0],g=h.trace,v=t.xa,m=t.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!==t.index){try{d=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(d<0||d>=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 L;for(M=[2*y[0]-y[1]],L=1;Lg&&(m=Math.max(m,Math.abs(t[i][o]-h)/(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":233}],397:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,l){var s,c,u,f=[],d=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),h=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!p&&"category"!==l.type){var g=e.length;if(!(g<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d||h)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]],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[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>l?l:t>s?s:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,i,l){if(n&&t>o){var s=h(e,i,l),c=h(r,i,l),u=t===a?0:1;return s[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function h(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 l,s,c=-1.1*e,d=-.1*e,p=t-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(e,r){var o=n.c2d(e,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(e,m+".start").set(E.start)}var j=b.end,U=r.r2l(P.end),V=void 0!==U;if((b.endFound||V)&&U!==r.r2l(j)){var q=V?U:a.aggNums(Math.max,null,h);E.end=r.l2r(q),V||a.nestedProperty(e,m+".start").set(E.end)}var G="autobin"+l;return!1===e._input[G]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[E,h]}e.exports={calc:function(t,e){var r,i,p,h,g=[],v=[],m=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=d(t,e,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],D=0,z=e.histnorm,P=e.histfunc,E=-1!==z.indexOf("density");_.enabled&&E&&(z=z.replace(/ ?density$/,""),E=!1);var I,R="max"===P||"min"===P?null:0,F=s.count,N=c[z],B=!1,H=function(t){return m.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==P&&(I=e[x],B="avg"===P,F=s[P]),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"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.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 tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=O[r],G?tt.ph0=tt.ph1=O[r].length?k[O[r][0]]:g[r]:(e._computePh=!0,tt.ph0=V(A[r]),tt.ph1=V(A[r+1],!0))),J.push(tt)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),l(J,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(J,e,X),J},calcAllAutoBins:d}},{"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"../bar/arrays_to_calcdata":335,"./average":403,"./bin_functions":405,"./bin_label_vals":406,"./norm_functions":414,"fast-isnumeric":23}],408:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],409:[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,l=n.nestedProperty,s=t("../../plots/cartesian/constraints").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,f,d,p,h,g,v,m=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 l=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),s=t[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",t.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",t.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:[t],dirs:[i],axType:l,calendar:t[i+"calendar"]||""}),t["_"+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=[],D="string"==typeof w.size,z="string"==typeof M.size,P=[],E=[],I=D?P:w,R=z?E:M,F=0,N=[],B=[],H=e.histnorm,j=e.histfunc,U=-1!==H.indexOf("density"),V="max"===j||"min"===j?null:0,q=i.count,G=o[H],Z=!1,Y=[],X=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(Z="avg"===j,q=i[j]);var Q=w.size,J=x(w.start),$=x(w.end)+(J-a.tickIncrement(J,Q,!1,m))/1e6;for(r=J;r<$;r=a.tickIncrement(r,Q,!1,m))C.push(V),P.push(r),Z&&O.push(0);P.push(r);var K,tt=C.length,et=(r-J)/tt,rt=(K=J+et/2,g.c2r(K,0,m)),nt=M.size,at=b(M.start),it=b(M.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((e-o.x0)/l.dx),d=Math.floor(Math.abs(r-o.y0)/l.dy);if(l._hasZ?u=o.z[d][f]:l._hasSource&&(u=l._canvas.el.getContext("2d").getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var g=h.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(p=!0)}var v,m=i.colormodel[l.colormodel],y=m.colormodel||l.colormodel,x=y.length,b=l._scaler(u),_=m.suffix,w=[];(l.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=y.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?v=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(v=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),k=o.x0+(f+.5)*l.dx,M=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[d,f],x0:s.c2p(o.x0+f*l.dx),x1:s.c2p(o.x0+(f+1)*l.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:A,text:v,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":145,"../../lib":233,"./constants":426}],431:[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":292,"./attributes":424,"./calc":425,"./defaults":427,"./event_data":428,"./hover":430,"./plot":432,"./style":433}],432:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=a.strTranslate,o=t("../../constants/xmlns_namespaces"),l=t("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,d=!(s||t._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),s=e[0],c=s.trace,p=d&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._fastImage=p;var h,g,v,m,y,x,b=s.z,_=s.x0,w=s.y0,T=s.w,k=s.h,M=c.dx,A=c.dy;for(x=0;void 0===h&&x0;)g=u.c2p(_+x*M),x--;for(x=0;void 0===m&&x0;)y=f.c2p(w+x*A),x--;if(gz[0];if(P||E){var I=h+L/2,R=m+S/2;O+="transform:"+i(I+"px",R+"px")+"scale("+(P?-1:1)+","+(E?-1:1)+")"+i(-I+"px",-R+"px")+";"}}C.attr("style",O);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=N((function(t,e){return b[e][t]})).toDataURL("image/png");else if(c._hasSource)if(p)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=N((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}C.attr({"xlink:href":t,height:S,width:L,x:h,y:m})}));t._promises.push(F)}function N(t){var e=document.createElement("canvas");e.width=L,e.height=S;var r,n=e.getContext("2d"),i=function(t){return a.constrain(Math.round(u.c2p(_+t*M)-h),0,L)},o=function(t){return a.constrain(Math.round(f.c2p(w+t*A)-m),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,g=d.fmt;for(x=0;x0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:s,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._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(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 v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(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":233,"../../plots/domain":306,"../bar/defaults":340,"./attributes":434,"fast-isnumeric":23}],438:[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":141}],439:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:v.castOption(b.bgcolor,t.pts)||t.color,borderColor:v.castOption(b.bordercolor,t.pts),fontFamily:v.castOption(_.family,t.pts),fontSize:v.castOption(_.size,t.pts),fontColor:v.castOption(_.color,t.pts),nameLength:v.castOption(b.namelength,t.pts),textAlign:v.castOption(b.align,t.pts),hovertemplate:v.castOption(u.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[m(t,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[m(t,u)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[m(l,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=[m(t,a)],i.click(e,n.event))}))}function b(t,e,r){var n=v.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=v.castOption(t._input.textfont.color,e.pts));var a=v.castOption(t.insidetextfont.family,e.pts)||v.castOption(t.textfont.family,e.pts)||r.family,i=v.castOption(t.insidetextfont.size,e.pts)||v.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function _(t,e){for(var r,n,a=0;ae&&e>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(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)}(h||p)&&((i=T(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i)),(h||d)&&((i=k(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i));for(var x=0,b=0,_=0;_=1)break}return g[x]}function T(t,e,r,n,a){e=Math.max(0,e-2*g);var i=t.width/t.height,o=L(i,n,e,r);return{scale:2*o/t.height,rCenter:M(i,o/e),rotate:A(a)}}function k(t,e,r,n,a){e=Math.max(0,e-2*g);var i=t.height/t.width,o=L(i,n,e,r);return{scale:2*o/t.width,rCenter:M(i,o/e),rotate:A(a+Math.PI/2)}}function M(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function L(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 S(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(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 O(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=z(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,l.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var s,c,u=(s=t.r,c=t.trace.aspectratio,s/(void 0===c?1:c)),f=e.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+=t.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-=t.titleBox.width/2),r=f/t.titleBox.width,n=D(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function D(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 z(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,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:v.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:v.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:s.castOption(a,t.i,"customdata")}}(e),_=v.getFirstFilled(a.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=s.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(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;h("pie",r),_(e,t),P(e,i);var d=s.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var d=n.select(this),h=e[0],g=h.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,l=v.getRotationAngle(o.rotation),s=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=S(r,a))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var m=n.select(this).selectAll("g.slice").data(e);m.enter().append("g").classed("slice",!0),m.exit().remove();var y=[[[],[]],[[],[]]],_=!1;m.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),d=u.selectAll("path.surface").data([a]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),g.pull){var m=+v.castOption(g.pull,a.pts)||0;m>0&&(o+=m*a.pxmid[0],c+=m*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=g.hole;if(a.v===h.vTotal){var k="M"+(o+a.px0[0])+","+(c+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?d.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):d.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;d.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else d.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}I(t,a,h);var L=v.castOption(g.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),d=s.ensureUniformFontSize(t,"outside"===L?function(t,e,r){var n=v.castOption(t.outsidetextfont.color,e.pts)||v.castOption(t.textfont.color,e.pts)||r.color,a=v.castOption(t.outsidetextfont.family,e.pts)||v.castOption(t.textfont.family,e.pts)||r.family,i=v.castOption(t.outsidetextfont.size,e.pts)||v.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(g,a,r.font):b(g,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,t);var m,y=l.bBox(u.node());if("outside"===L)m=C(y,a);else if(m=w(y,a,h),"auto"===L&&m.scale<1){var x=s.ensureUniformFontSize(t,g.outsidetextfont);u.call(l.font,x),m=C(y=l.bBox(u.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:E(h.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=c+k[1]*m.rCenter+(m.y||0),R(m,y),m.outside){var M=m.targetY;a.yLabelMin=M-y.height/2,a.yLabelMid=M,a.yLabelMax=M+y.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}m.fontSize=d.size,p(g.type,m,r),e[i].transform=m,u.attr("transform",s.getTextTransform(m))}))}function O(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=g.title.text;g._meta&&(a=s.templateString(a,g._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,g.title.font).call(f.convertToTspans,t),e="middle center"===g.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}}(h):O(h,i),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),_&&function(t,e){var r,n,a,i,o,l,s,c,u,f,d,p,h;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?t.yLabelMin:t.yLabelMax,g=n?t.yLabelMax:t.yLabelMin,m=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-h;if(y*s>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(v.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-t.labelExtraY)*s>0&&(t.labelExtraY+=y):(g+t.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(t)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?g: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=t[n][r]).sort(a),u=t[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(i+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(m,g),_&&g.automargin){var k=l.bBox(d.node()),M=g.domain,A=i.w*(M.x[1]-M.x[0]),L=i.h*(M.y[1]-M.y[0]),S=(.5*A-h.r)/i.w,D=(.5*L-h.r)/i.h;a.autoMargin(t,"pie."+g.uid+".automargin",{xl:M.x[0]-S,xr:M.x[1]+S,yb:M.y[0]-D,yt:M.y[1]+D,l:Math.max(h.cx-h.r-k.left,0),r:Math.max(k.right-(h.cx+h.r),0),b:Math.max(k.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-k.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:I,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:R}},{"../../components/color":105,"../../components/drawing":127,"../../components/fx":145,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../bar/constants":338,"../bar/uniform_text":352,"./event_data":438,"./helpers":439,d3:21}],444:[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":352,"./style_one":445,d3:21}],445:[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,l=a(i.width,e.pts)||0;t.style("stroke-width",l).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":105,"./helpers":439}],446:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rs&&S[m].gap;)m--;for(x=S[m].s,g=S.length-1;g>m;g--)S[g].s=x;for(;sA[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}}}}}},{}],454:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),l=t("./subtypes"),s=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),d=t("./line_defaults"),p=t("./line_shape_defaults"),h=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=s(t,e,v,m);if(y||(e.visible=!1),e.visible){c(t,e,v,m);var x=u(t,e,v,m),b=!x&&yG!=(F=z[O][1])>=G&&(E=z[O-1][0],I=z[O][0],F-R&&(P=E+(I-E)*(G-R)/(F-R),j=Math.min(j,P),U=Math.max(U,P)));j=Math.max(j,0),U=Math.min(U,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(t,{distance:t.maxHoverDistance,x0:j,x1:U,y0:G,y1:G,color:Z,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":105,"../../components/fx":145,"../../lib":233,"../../registry":326,"./get_trace_color":457}],459:[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":292,"./arrays_to_calcdata":446,"./attributes":447,"./calc":448,"./cross_trace_calc":452,"./cross_trace_defaults":453,"./defaults":454,"./format_labels":456,"./hover":458,"./marker_colorbar":465,"./plot":468,"./select":469,"./style":471,"./subtypes":472}],460:[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,l,s){var c=(t.marker||{}).color;(l("line.color",r),a(t,"line"))?i(t,e,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116,"../../lib":233}],461:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=t("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=e.xaxis,S=e.yaxis,C="log"===L.type,O="log"===S.type,D=L._length,z=S._length,P=e.connectGaps,E=e.baseTolerance,I=e.shape,R="linear"===I,F=e.fill&&"none"!==e.fill,N=[],B=f.minTolerance,H=t.length,j=new Array(H),U=0;function V(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),s=e.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*z*(L._m>0?o:l)/(S._m*D*(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 q(t,e,r,n){var a=r-t,i=n-e,o=.5-t,l=.5-e,s=a*a+i*i,c=a*o+i*l;if(c>0&&crt||t[1]at)return[u(t[0],et,rt),u(t[1],nt,at)]}function lt(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 st(t,e,r){return function(n,a){var i=ot(n),o=ot(a),l=[];if(i&&o&<(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.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 l}}function ct(t){var e=t[0],r=t[1],n=e===j[U-1][0],a=r===j[U-1][1];if(!n||!a)if(U>1){var i=e===j[U-2][0],o=r===j[U-2][1];n&&(e===et||e===rt)&&i?o?U--:j[U-1]=t:a&&(r===nt||r===at)&&o?i?U--:j[U-1]=t:j[U++]=t}else j[U++]=t}function ut(t){j[U-1][0]!==t[0]&&j[U-1][1]!==t[1]&&ct([W,Q]),ct(t),J=null,W=Q=0}function ft(t){if(M=t[0]/D,A=t[1]/z,Y=t[0]rt?rt:0,X=t[1]at?at:0,Y||X){if(U)if(J){var e=K(J,t);e.length>1&&(ut(e[0]),j[U++]=e[1])}else $=K(j[U-1],t)[0],j[U++]=$;else j[U++]=[Y||t[0],X||t[1]];var r=j[U-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Q!==X?ct(W&&Q?(n=J,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]):[W||Y,Q||X]):W&&Q&&ct([W,Q])),ct([Y,X])):W-Y&&Q-X&&ct([Y||W,X||Q]),J=t,W=Y,Q=X}else J&&ut(K(J,t)[0]),j[U++]=t;var n,a,i,o}for("linear"===I||"spline"===I?K=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&&Z(o,t)G(h,dt))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=t.length||!h)break;ft(h),n=h}}else ft(d)}J&&ct([W||J[0],Q||J[1]]),N.push(j.slice(0,U))}return N}},{"../../constants/numerical":212,"../../lib":233,"./constants":451}],462:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],463:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,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(e,a):0}}},{"fast-isnumeric":23}],465:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],466:[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,l,s,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":105,"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116,"./subtypes":472}],467:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":212,"../../lib":233}],468:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,l=i.identity,s=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;function p(t,e,r,f,p,h,g){var v;!function(t,e,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(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}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")(t,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 D,z,P="",E=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,U,V="",q="",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(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),w.smoothing):s.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.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}),U=_._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",D).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",D),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,t),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"+V.substr(1)).call(s.singleFillStyle)):y(S).attr("d",V+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&P?("tonext"===_.fill?y(C).attr("d",V+"Z"+P+"Z").call(s.singleFillStyle):y(C).attr("d",V+"L"+P.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(e,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=tt(u),h=et,g=et;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===t._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=e.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,t).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=y(a);s.translatePoint(e,i,x,b)?(s.singlePointStyle(e,i,u,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.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,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"));s.translatePoint(t,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(s.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()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,t),s.setClipUrl(L,X,t)}function W(t){y(t).attr("d","M0,0Z")}function Q(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(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,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(t,e,r);((u=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),u.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");s.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,l);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&&(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(t,n,e,r,v,this,i)}))}))):u.each((function(r,n){p(t,n,e,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":127,"../../lib":233,"../../lib/polygon":245,"../../registry":326,"./line_points":461,"./link_traces":463,"./subtypes":472,d3:21}],469:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(t,e){m.push(t._hovertitle+": "+e)}}},{"../scatter/hover":458}],481:[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":322,"../scatter/marker_colorbar":465,"../scatter/select":469,"../scatter/style":471,"./attributes":475,"./calc":476,"./defaults":477,"./event_data":478,"./format_labels":479,"./hover":480,"./plot":482}],482:[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":468}],483:[function(t,e,r){"use strict";var n=t("../box/attributes"),a=t("../../lib/extend").extendFlat;e.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":227,"../box/attributes":353}],484:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/calc"),o=t("./helpers"),l=t("../../constants/numerical").BADNUM;function s(t,e,r){var a=e.max-e.min;if(!a)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(i,o,e.q3-e.q1),a/100)}function c(t,e,r,n){var i,o=t.spanmode,s=t.span||[],c=[e.min,e.max],u=[e.min-2*n,e.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,t[e.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}e.exports=function(t,e){var r=i(t,e);if(r[0].t.empty)return r;for(var l=t._fullLayout,u=a.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,g=0;g0){var y,x,b,_,w,T=t.xa,k=t.ya;"h"===d.orientation?(w=e,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var M=f[t.index];if(w>=M.span[0]&&w<=M.span[1]){var A=n.extendFlat({},t),L=_.c2p(w,!0),S=o.getKdeValue(M,d,w),C=o.getPositionOnKdePath(M,d,L),O=b._offset,D=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 z=y+"Spike";A[z]=m[0][z],m[0].spikeDistance=void 0,m[0][z]=void 0,A.hovertemplate=!1,v.push(A),(u={stroke:t.color})[y+"1"]=n.constrain(O+C[0],O,O+D),u[y+"2"]=n.constrain(O+C[1],O,O+D),u[x+"1"]=u[x+"2"]=_._offset+L}}h&&(v=v.concat(m))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var P=s.selectAll(".violinline-"+d.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===l?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":233,"../../plots/cartesian/axes":279,"../box/hover":358,"./helpers":487}],489:[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":292,"../box/defaults":356,"../box/select":363,"../scatter/style":471,"./attributes":483,"./calc":484,"./cross_trace_calc":485,"./defaults":486,"./hover":488,"./layout_attributes":490,"./layout_defaults":491,"./plot":492,"./style":493}],490:[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":233,"../box/layout_attributes":360}],491:[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":233,"../box/layout_defaults":361,"./layout_attributes":490}],492:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),l=t("../scatter/line_points"),s=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,f=e.xaxis,d=e.yaxis;function p(t){var e=l(t,{xaxis:f,yaxis:d,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],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,g=l.bdPos,v=e[l.valLetter+"axis"],m=e[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(t){var e,r,a,i,o,s,f,d,_=n.select(this),w=t.density,T=w.length,k=m.c2l(t.pos+h,!0),M=m.l2p(k);if(c.width)e=l.maxKDE/g;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/g*(A.maxCount/t.pts.length):A.maxKDE/g}if(x){for(f=new Array(T),o=0;o