/** * plotly.js (geo - minified) v1.52.2 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=e()}}(function(){return function(){return function e(t,r,n){function a(o,l){if(!r[o]){if(!t[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:{}};t[o][0].call(u.exports,function(e){return a(t[o][1][e]||e)},u,u.exports,e,t,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';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":168}],2:[function(e,t,r){"use strict";t.exports=e("../src/traces/choropleth")},{"../src/traces/choropleth":275}],3:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":148}],4:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./scattergeo"),e("./choropleth")]),t.exports=n},{"./choropleth":2,"./core":3,"./scattergeo":5}],5:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattergeo")},{"../src/traces/scattergeo":316}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/meta"),a=6378137;function i(e){var t=0;if(e&&e.length>0){t+=Math.abs(o(e[0]));for(var r=1;r2){for(s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=d,r.lengthToDegrees=function(e,t){return p(d(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=p,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(d(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=h,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!h(e))throw new Error("bbox must only contain numbers")})},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,l,s,c,u,f,d=0,p=0,h=e.type,g="FeatureCollection"===h,v="Feature"===h,m=g?e.features.length:1,y=0;yc||p>u||h>f)return s=a,c=r,u=p,f=h,void(o=0);var g=n.lineString([s,a],e.properties);if(!1===t(g,r,i,h,o))return!1;o++,s=a})&&void 0}}})}function u(e,t){if(!e)throw new Error("geojson is required");s(e,function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var l=0;l0&&l.length>i){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else l=o[t]=r,++e._eventsCount;return e}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var s=new Error('Unhandled "error" event. ('+t+")");throw s.context=t,s}if(!(r=o[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,a=v(e,n),i=0;i=0;o--)if(r[o]===t||r[o].listener===t){l=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(var r=t,n=r+1,a=e.length;n=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],12:[function(e,t,r){t.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],13:[function(e,t,r){!function(){var e={version:"3.5.17"},r=[].slice,n=function(e){return r.call(e)},a=this.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(e,t){s.call(this,e,t+"")},l.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function d(e,t){return et?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function h(e){return!isNaN(e)}function g(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=d,e.descending=function(e,t){return te?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.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},e.max=function(e,t){var r,n,a=-1,i=e.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},e.extent=function(e,t){var r,n,a,i=-1,o=e.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)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(d);function m(e){return e.length}e.bisectLeft=v.left,e.bisect=e.bisectRight=v.right,e.bisector=function(e){return g(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var y=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(e){var t=1;for(;e*t%1;)t*=10;return t}(y(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)=a.length)return r?r.call(n,i):t?i.sort(t):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new b;++d=a.length)return t;var n=[],o=i[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),o?n.sort(function(e,t){return o(e.key,t.key)}):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new P;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function G(e){return q(e,Y),e}var V=function(e,t){return t.querySelector(e)},U=function(e,t){return t.querySelectorAll(e)},Z=function(e,t){var r=e.matches||e[z(e,"matchesSelector")];return(Z=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},U=Sizzle,Z=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var Y=e.selection.prototype=[];function X(e){return"function"==typeof e?e:function(){return V(e,this)}}function W(e){return"function"==typeof e?e:function(){return U(e,this)}}Y.select=function(e){var t,r,n,a,i=[];e=X(e);for(var o=-1,l=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),Q.hasOwnProperty(r)?{space:Q[r],local:e}:e}},Y.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each($(r,t[r]));return this}return this.each($(t,r))},Y.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=te(e)).length,a=-1;if(t=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Y.sort=function(e){e=function(e){arguments.length||(e=d);return function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(t=t.slice(0,o));var s=he.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=ve),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=fe,e.selection.enter.prototype=de,de.append=Y.append,de.empty=Y.empty,de.node=Y.node,de.call=Y.call,de.size=Y.size,de.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l=n&&(n=t+1);!(o=l[n])&&++n0?1:e<0?-1:0}function De(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}function ze(e){return e>1?0:e<-1?Te:Math.acos(e)}function Re(e){return e>1?Se:e<-1?-Se:Math.asin(e)}function Ee(e){return((e=Math.exp(e))+1/e)/2}function Ie(e){return(e=Math.sin(e/2))*e}var Ne=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,f=s-i,d=u*u+f*f;if(d0&&(t=t.transition().duration(g)),t.call(w.event)}function L(){c&&c.domain(s.range().map(function(e){return(e-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(e){return(e-d.y)/d.k}).map(u.invert))}function S(e){v++||e({type:"zoomstart"})}function C(e){L(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(e){--v||(e({type:"zoomend"}),r=null)}function O(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,function(){n=1,T(e.mouse(t),i),C(r)}).on(x,function(){a.on(y,null).on(x,null),l(n),P(r)}),i=k(e.mouse(t)),l=xe(t);pl.call(t),S(r)}function D(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),p=xe(r);function h(){var n=e.touches(r);return t=d.k,n.forEach(function(e){e.identifier in a&&(a[e.identifier]=k(e))}),n}function g(){var t=e.event.target;e.select(t).on(s,v).on(c,y),u.push(t);for(var n=e.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=e.touches(r);pl.call(r);for(var d=0,p=f.length;d360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new it(i(e+120),i(e),i(e-120))}function Ue(t,r,n){return this instanceof Ue?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ue?new Ue(t.h,t.c,t.l):tt(t instanceof Xe?t.l:(t=dt((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ue(t,r,n)}Ge.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,this.l/e)},Ge.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,e*this.l)},Ge.rgb=function(){return Ve(this.h,this.s,this.l)},e.hcl=Ue;var Ze=Ue.prototype=new He;function Ye(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Xe(r,Math.cos(e*=Ce)*t,Math.sin(e)*t)}function Xe(e,t,r){return this instanceof Xe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Xe?new Xe(e.l,e.a,e.b):e instanceof Ue?Ye(e.h,e.c,e.l):dt((e=it(e)).r,e.g,e.b):new Xe(e,t,r)}Ze.brighter=function(e){return new Ue(this.h,this.c,Math.min(100,this.l+We*(arguments.length?e:1)))},Ze.darker=function(e){return new Ue(this.h,this.c,Math.max(0,this.l-We*(arguments.length?e:1)))},Ze.rgb=function(){return Ye(this.h,this.c,this.l).rgb()},e.lab=Xe;var We=18,Je=.95047,Qe=1,$e=1.08883,Ke=Xe.prototype=new He;function et(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new it(at(3.2404542*(a=rt(a)*Je)-1.5371385*(n=rt(n)*Qe)-.4985314*(i=rt(i)*$e)),at(-.969266*a+1.8760108*n+.041556*i),at(.0556434*a-.2040259*n+1.0572252*i))}function tt(e,t,r){return e>0?new Ue(Math.atan2(r,t)*Pe,Math.sqrt(t*t+r*r),e):new Ue(NaN,NaN,e)}function rt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function nt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function it(e,t,r){return this instanceof it?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof it?new it(e.r,e.g,e.b):ut(""+e,it,Ve):new it(e,t,r)}function ot(e){return new it(e>>16,e>>8&255,255&e)}function lt(e){return ot(e)+""}Ke.brighter=function(e){return new Xe(Math.min(100,this.l+We*(arguments.length?e:1)),this.a,this.b)},Ke.darker=function(e){return new Xe(Math.max(0,this.l-We*(arguments.length?e:1)),this.a,this.b)},Ke.rgb=function(){return et(this.l,this.a,this.b)},e.rgb=it;var st=it.prototype=new He;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ut(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.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 t(ht(a[0]),ht(a[1]),ht(a[2]))}return(i=gt.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function ft(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t0&&s<1?0:n),new qe(n,a,s)}function dt(e,t,r){var n=nt((.4124564*(e=pt(e))+.3575761*(t=pt(t))+.1804375*(r=pt(r)))/Je),a=nt((.2126729*e+.7151522*t+.072175*r)/Qe);return Xe(116*a-16,500*(n-a),200*(a-nt((.0193339*e+.119192*t+.9503041*r)/$e)))}function pt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ht(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}st.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void l.error.call(o,e)}l.load.call(o,e)}else l.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}}),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!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(e){a(null,e)}),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,l,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}gt.forEach(function(e,t){gt.set(e,ot(t))}),e.functor=vt,e.xhr=mt(O),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=yt(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function l(t){return t.map(s).join(e)}function s(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,function(e,n){if(r)return r(e,n-1);var a=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=t?function(e,r){return t(a(e),r)}:a})},a.parseRows=function(e,t){var r,a,i={},o={},l=[],s=e.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(wt),wt=setTimeout(Tt,t)),_t=0):(_t=1,kt(Tt))}function At(){for(var e=Date.now(),t=xt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Lt(){for(var e,t=xt,r=1/0;t;)t.c?(t.t8?function(e){return e/r}:function(e){return e*r},symbol:e}});function Pt(t){var r=t.decimal,n=t.thousands,a=t.grouping,i=t.currency,o=a&&n?function(e,t){for(var r=e.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>t&&(l=Math.max(1,t-s)),i.push(e.substring(r-=l,r+l)),!((s+=l+1)>t));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:O;return function(t){var n=Ot.exec(t),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=Dt.get(h)||zt;var b=u&&d;return function(t){var n=m;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(g<0){var c=e.formatPrefix(t,p);t=c.scale(t),n=c.symbol+m}else t*=g;var _,w,k=(t=h(t,p)).lastIndexOf(".");if(k<0){var M=x?t.lastIndexOf("e"):-1;M<0?(_=t,w=""):(_=t.substring(0,M),w=t.substring(M))}else _=t.substring(0,k),w=r+t.substring(k+1);!u&&d&&(_=o(_,1/0));var T=v.length+_.length+w.length+(b?0:i.length),A=T"===l?A+i+t:"^"===l?A.substring(0,T>>=1)+i+t+A.substring(T):i+(b?t:A+t))+n}}}e.formatPrefix=function(t,r){var n=0;return(t=+t)&&(t<0&&(t*=-1),r&&(t=e.round(t,St(t,r))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ct[8+n/3]};var Ot=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Dt=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,r){return(t=e.round(t,St(t,r))).toFixed(Math.max(0,Math.min(20,St(t*(1+1e-15),r))))}});function zt(e){return e+""}var Rt=e.time={},Et=Date;function It(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}It.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(){Nt.setUTCDate.apply(this._,arguments)},setDay:function(){Nt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Nt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Nt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Nt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Nt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Nt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Nt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Nt.setTime.apply(this._,arguments)}};var Nt=Date.prototype;function Ft(e,t,r){function n(t){var r=e(t),n=i(r,1);return t-r1)for(;o=c)return-1;if(37===(a=t.charCodeAt(l++))){if(o=t.charAt(l++),!(i=w[o in Ht?t.charAt(l++):o])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(e){var t=u(e);function r(e){try{var r=new(Et=It);return r._=e,t(r)}finally{Et=Date}}return r.parse=function(e){try{Et=It;var r=t.parse(e);return r&&r._}finally{Et=Date}},r.toString=t.toString,r},u.multi=u.utc.multi=sr;var d=e.map(),p=Ut(o),h=Zt(o),g=Ut(l),v=Zt(l),m=Ut(s),y=Zt(s),x=Ut(c),b=Zt(c);i.forEach(function(e,t){d.set(e.toLowerCase(),t)});var _={a:function(e){return l[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:u(r),d:function(e,t){return Vt(e.getDate(),t,2)},e:function(e,t){return Vt(e.getDate(),t,2)},H:function(e,t){return Vt(e.getHours(),t,2)},I:function(e,t){return Vt(e.getHours()%12||12,t,2)},j:function(e,t){return Vt(1+Rt.dayOfYear(e),t,3)},L:function(e,t){return Vt(e.getMilliseconds(),t,3)},m:function(e,t){return Vt(e.getMonth()+1,t,2)},M:function(e,t){return Vt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Vt(e.getSeconds(),t,2)},U:function(e,t){return Vt(Rt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Vt(Rt.mondayOfYear(e),t,2)},x:u(n),X:u(a),y:function(e,t){return Vt(e.getFullYear()%100,t,2)},Y:function(e,t){return Vt(e.getFullYear()%1e4,t,4)},Z:or,"%":function(){return"%"}},w={a:function(e,t,r){g.lastIndex=0;var n=g.exec(t.slice(r));return n?(e.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){p.lastIndex=0;var n=p.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){x.lastIndex=0;var n=x.exec(t.slice(r));return n?(e.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){m.lastIndex=0;var n=m.exec(t.slice(r));return n?(e.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,t,r){return f(e,_.c.toString(),t,r)},d:er,e:er,H:rr,I:rr,j:tr,L:ir,m:Kt,M:nr,p:function(e,t,r){var n=d.get(t.slice(r,r+=2).toLowerCase());return null==n?-1:(e.p=n,r)},S:ar,U:Xt,w:Yt,W:Wt,x:function(e,t,r){return f(e,_.x.toString(),t,r)},X:function(e,t,r){return f(e,_.X.toString(),t,r)},y:Qt,Y:Jt,Z:$t,"%":lr};return u}Rt.year=Ft(function(e){return(e=Rt.day(e)).setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),Rt.years=Rt.year.range,Rt.years.utc=Rt.year.utc.range,Rt.day=Ft(function(e){var t=new Et(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),Rt.days=Rt.day.range,Rt.days.utc=Rt.day.utc.range,Rt.dayOfYear=function(e){var t=Rt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var r=Rt[e]=Ft(function(e){return(e=Rt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var r=Rt.year(e).getDay();return Math.floor((Rt.dayOfYear(e)+(r+t)%7)/7)-(r!==t)});Rt[e+"s"]=r.range,Rt[e+"s"].utc=r.utc.range,Rt[e+"OfYear"]=function(e){var r=Rt.year(e).getDay();return Math.floor((Rt.dayOfYear(e)+(r+t)%7)/7)}}),Rt.week=Rt.sunday,Rt.weeks=Rt.sunday.range,Rt.weeks.utc=Rt.sunday.utc.range,Rt.weekOfYear=Rt.sundayOfYear;var Ht={"-":"",_:" ",0:"0"},qt=/^\s*\d+/,Gt=/^%/;function Vt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i68?1900:2e3),r+a[0].length):-1}function $t(e,t,r){return/^[+-]\d{4}$/.test(t=t.slice(r,r+5))?(e.Z=-t,r+5):-1}function Kt(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function er(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function tr(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+3));return n?(e.j=+n[0],r+n[0].length):-1}function rr(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function nr(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function ar(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ir(e,t,r){qt.lastIndex=0;var n=qt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function or(e){var t=e.getTimezoneOffset(),r=t>0?"-":"+",n=y(t)/60|0,a=y(t)%60;return r+Vt(n,"0",2)+Vt(a,"0",2)}function lr(e,t,r){Gt.lastIndex=0;var n=Gt.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function sr(e){for(var t=e.length,r=-1;++r=0?1:-1,l=o*i,s=Math.cos(t),c=Math.sin(t),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Pr.add(Math.atan2(d,f)),r=e,n=s,a=c}Or.point=function(o,l){Or.point=i,r=(e=o)*Ce,n=Math.cos(l=(t=l)*Ce/2+Te/4),a=Math.sin(l)},Or.lineEnd=function(){i(e,t)}}function zr(e){var t=e[0],r=e[1],n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}function Rr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Er(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Ir(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Nr(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Fr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function jr(e){return[Math.atan2(e[1],e[0]),Re(e[2])]}function Br(e,t){return y(e[0]-t[0])ke?a=90:c<-ke&&(r=-90),f[0]=t,f[1]=n}};function p(e,i){u.push(f=[t=e,n=e]),ia&&(a=i)}function h(e,o){var l=zr([e*Ce,o*Ce]);if(s){var c=Er(s,l),u=Er([c[1],-c[0],0],c);Fr(u),u=jr(u);var f=e-i,d=f>0?1:-1,h=u[0]*Pe*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?e_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e):n>=t?(en&&(n=e)):e>i?_(t,e)>_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e)}else p(e,o);s=l,i=e}function g(){d.point=h}function v(){f[0]=t,f[1]=n,d.point=p,s=null}function m(e,t){if(s){var r=e-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=e,l=t;Or.point(e,t),h(e,t)}function x(){Or.lineStart()}function b(){m(o,l),Or.lineEnd(),y(c)>ke&&(t=-(n=180)),f[0]=t,f[1]=n,s=null}function _(e,t){return(t-=e)<0?t+360:t}function w(e,t){return e[0]-t[0]}function k(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e_(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,t=p[0],n=g[1])}return u=f=null,t===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,r],[n,a]]}}(),e.geo.centroid=function(t){xr=br=_r=wr=kr=Mr=Tr=Ar=Lr=Sr=Cr=0,e.geo.stream(t,Hr);var r=Lr,n=Sr,a=Cr,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 Jr(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n=0?1:-1,k=w*_,M=k>Te,T=h*x;if(Pr.add(Math.atan2(T*w*Math.sin(k),g*b+T*Math.cos(k))),i+=M?_+w*Ae:_,M^d>=r^m>=r){var A=Er(zr(f),zr(e));Fr(A);var L=Er(a,A);Fr(L);var S=(M^_>=0?-1:1)*Re(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=M^_>=0?1:-1)}if(!v++)break;d=m,h=x,g=b,f=e}}return(i<-ke||i0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i1&&2&t&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Kr))}return u}}function Kr(e){return e.length>1}function en(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,r){e.push([t,r])},lineEnd:E,buffer:function(){var r=t;return t=[],e=null,r},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function tn(e,t){return((e=e.x)[0]<0?e[1]-Se-ke:Se-e[1])-((t=t.x)[0]<0?t[1]-Se-ke:Se-t[1])}var rn=$r(Xr,function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,o){var l=i>0?Te:-Te,s=y(i-r);y(s-Te)0?Se:-Se),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(i,n),t=0):a!==l&&s>=Te&&(y(r-a)ke?Math.atan((Math.sin(t)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(t))*Math.sin(e))/(a*i*o)):(t+n)/2}(r,n,i,o),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=i,n=o),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}},function(e,t,r,n){var a;if(null==e)a=r*Se,n.point(-Te,a),n.point(0,a),n.point(Te,a),n.point(Te,0),n.point(Te,-a),n.point(0,-a),n.point(-Te,-a),n.point(-Te,0),n.point(-Te,a);else if(y(e[0]-t[0])>ke){var i=e[0]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}}}}}}var an=1e9;function on(t,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=en(),w=nn(t,r,n,a),k={point:A,lineStart:function(){k.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()));k.point=A,m&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=e.merge(c);var r=function(e){for(var t=0,r=u.length,n=e[1],a=0;an&&De(c,i,e)>0&&++t:i[1]<=n&&De(c,i,e)<0&&--t,c=i;return 0!==t}([t,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),M(null,null,1,s),s.lineEnd()),i&&Wr(c,o,r,M,s),s.polygonEnd()),c=u=f=null}};function M(e,o,s,c){var u=0,f=0;if(null==e||(u=i(e,s))!==(f=i(o,s))||l(e,o)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function T(e,i){return t<=e&&e<=n&&r<=i&&i<=a}function A(e,t){T(e,t)&&s.point(e,t)}function L(e,t){var r=T(e=Math.max(-an,Math.min(an,e)),t=Math.max(-an,Math.min(an,t)));if(u&&f.push([e,t]),y)d=e,p=t,h=r,y=!1,r&&(s.lineStart(),s.point(e,t));else if(r&&m)s.point(e,t);else{var n={a:{x:g,y:v},b:{x:e,y:t}};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(e,t),x=!1)}g=e,v=t,m=r}return k};function i(e,a){return y(e[0]-t)0?0:3:y(e[0]-n)0?2:1:y(e[1]-r)0?1:0:a>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var r=i(e,1),n=i(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}}function ln(e){var t=0,r=Te/3,n=On(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*Te/180,r=e[1]*Te/180):[t/Te*180,r/Te*180]},a}function sn(e,t){var r=Math.sin(e),n=(r+Math.sin(t))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(e,t){var r=Math.sqrt(a-2*n*Math.sin(t))/n;return[r*Math.sin(e*=n),i-r*Math.cos(e)]}return o.invert=function(e,t){var r=i-t;return[Math.atan2(e,r)/n,Re((a-(e*e+r*r)*n*n)/(2*n))]},o}e.geo.clipExtent=function(){var e,t,r,n,a,i,o={stream:function(e){return a&&(a.valid=!1),(a=i(e)).valid=!0,a},extent:function(l){return arguments.length?(i=on(e=+l[0][0],t=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[e,t],[r,n]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return ln(sn)}).raw=sn,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){var t,r,n,a,i=e.geo.albers(),o=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(e,r){t=[e,r]}};function c(e){var i=e[0],o=e[1];return t=null,r(i,o),t||(n(i,o),t)||a(i,o),t}return c.invert=function(e){var t=i.scale(),r=i.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(e)},c.stream=function(e){var t=i.stream(e),r=o.stream(e),n=l.stream(e);return{point:function(e,a){t.point(e,a),r.point(e,a),n.point(e,a)},sphere:function(){t.sphere(),r.sphere(),n.sphere()},lineStart:function(){t.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){t.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){t.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){t.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(e){return arguments.length?(i.precision(e),o.precision(e),l.precision(e),c):i.precision()},c.scale=function(e){return arguments.length?(i.scale(e),o.scale(.35*e),l.scale(e),c.translate(i.translate())):i.scale()},c.translate=function(e){if(!arguments.length)return i.translate();var t=i.scale(),u=+e[0],f=+e[1];return r=i.translate(e).clipExtent([[u-.455*t,f-.238*t],[u+.455*t,f+.238*t]]).stream(s).point,n=o.translate([u-.307*t,f+.201*t]).clipExtent([[u-.425*t+ke,f+.12*t+ke],[u-.214*t-ke,f+.234*t-ke]]).stream(s).point,a=l.translate([u-.205*t,f+.212*t]).clipExtent([[u-.214*t+ke,f+.166*t+ke],[u-.115*t-ke,f+.234*t-ke]]).stream(s).point,c},c.scale(1070)};var cn,un,fn,dn,pn,hn,gn={point:E,lineStart:E,lineEnd:E,polygonStart:function(){un=0,gn.lineStart=vn},polygonEnd:function(){gn.lineStart=gn.lineEnd=gn.point=E,cn+=y(un/2)}};function vn(){var e,t,r,n;function a(e,t){un+=n*e-r*t,r=e,n=t}gn.point=function(i,o){gn.point=a,e=r=i,t=n=o},gn.lineEnd=function(){a(e,t)}}var mn={point:function(e,t){epn&&(pn=e);thn&&(hn=t)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E};function yn(){var e=xn(4.5),t=[],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=xn(t),r},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function n(r,n){t.push("M",r,",",n,e)}function a(e,n){t.push("M",e,",",n),r.point=i}function i(e,r){t.push("L",e,",",r)}function o(){r.point=n}function l(){t.push("Z")}return r}function xn(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var bn,_n={point:wn,lineStart:kn,lineEnd:Mn,polygonStart:function(){_n.lineStart=Tn},polygonEnd:function(){_n.point=wn,_n.lineStart=kn,_n.lineEnd=Mn}};function wn(e,t){_r+=e,wr+=t,++kr}function kn(){var e,t;function r(r,n){var a=r-e,i=n-t,o=Math.sqrt(a*a+i*i);Mr+=o*(e+r)/2,Tr+=o*(t+n)/2,Ar+=o,wn(e=r,t=n)}_n.point=function(n,a){_n.point=r,wn(e=n,t=a)}}function Mn(){_n.point=wn}function Tn(){var e,t,r,n;function a(e,t){var a=e-r,i=t-n,o=Math.sqrt(a*a+i*i);Mr+=o*(r+e)/2,Tr+=o*(n+t)/2,Ar+=o,Lr+=(o=n*e-r*t)*(r+e),Sr+=o*(n+t),Cr+=3*o,wn(r=e,n=t)}_n.point=function(i,o){_n.point=a,wn(e=r=i,t=n=o)},_n.lineEnd=function(){a(e,t)}}function An(e){var t=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(e){return t=e,r},result:E};function n(r,n){e.moveTo(r+t,n),e.arc(r,n,t,0,Ae)}function a(t,n){e.moveTo(t,n),r.point=i}function i(t,r){e.lineTo(t,r)}function o(){r.point=n}function l(){e.closePath()}return r}function Ln(e){var t=.5,r=Math.cos(30*Ce),n=16;function a(t){return(n?function(t){var r,a,o,l,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),v.lineStart=_},polygonEnd:function(){t.polygonEnd(),v.lineStart=y}};function m(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){f=NaN,v.point=x,t.lineStart()}function x(r,a){var o=zr([r,a]),l=e(r,a);i(f,d,u,p,h,g,f=l[0],d=l[1],u=r,p=o[0],h=o[1],g=o[2],n,t),t.point(f,d)}function b(){v.point=m,t.lineEnd()}function _(){y(),v.point=w,v.lineEnd=k}function w(e,t){x(r=e,t),a=f,o=d,l=p,s=h,c=g,v.point=x}function k(){i(f,d,u,p,h,g,a,o,r,l,s,c,n,t),v.lineEnd=b,b()}return v}:function(t){return Cn(t,function(r,n){r=e(r,n),t.point(r[0],r[1])})})(t)}function i(n,a,o,l,s,c,u,f,d,p,h,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*t&&v--){var w=l+p,k=s+h,M=c+g,T=Math.sqrt(w*w+k*k+M*M),A=Math.asin(M/=T),L=y(y(M)-1)t||y((x*O+b*D)/_-.5)>.3||l*p+s*h+c*g0&&16,a):Math.sqrt(t)},a}function Sn(e){this.stream=e}function Cn(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Pn(e){return On(function(){return e})()}function On(t){var r,n,a,i,o,l,s=Ln(function(e,t){return[(e=r(e,t))[0]*c+i,o-e[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=rn,x=O,b=null,_=null;function w(e){return[(e=a(e[0]*Ce,e[1]*Ce))[0]*c+i,o-e[1]*c]}function k(e){return(e=a.invert((e[0]-i)/c,(o-e[1])/c))&&[e[0]*Pe,e[1]*Pe]}function M(){a=Yr(n=En(h,g,v),r);var e=r(d,p);return i=u-e[0]*c,o=f+e[1]*c,T()}function T(){return l&&(l.valid=!1,l=null),w}return w.stream=function(e){return l&&(l.valid=!1),(l=Dn(m(n,s(x(e))))).valid=!0,l},w.clipAngle=function(e){return arguments.length?(m=null==e?(b=e,rn):function(e){var t=Math.cos(e),r=t>0,n=y(t)>ke;return $r(a,function(e){var t,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?Te:-Te),d):0;if(!t&&(c=s=g)&&e.lineStart(),g!==s&&(p=i(t,h),(Br(t,p)||Br(h,p))&&(h[0]+=ke,h[1]+=ke,g=a(h[0],h[1]))),g!==s)u=0,g?(e.lineStart(),p=i(h,t),e.point(p[0],p[1])):(p=i(t,h),e.point(p[0],p[1]),e.lineEnd()),t=p;else if(n&&t&&r^g){var m;v&l||!(m=i(h,t,!0))||(u=0,r?(e.lineStart(),e.point(m[0][0],m[0][1]),e.point(m[1][0],m[1][1]),e.lineEnd()):(e.point(m[1][0],m[1][1]),e.lineEnd(),e.lineStart(),e.point(m[0][0],m[0][1])))}!g||t&&Br(t,h)||e.point(h[0],h[1]),t=h,s=g,l=v},lineEnd:function(){s&&e.lineEnd(),t=null},clean:function(){return u|(c&&s)<<1}}},jn(e,6*Ce),r?[0,-e]:[-Te,e-Te]);function a(e,r){return Math.cos(e)*Math.cos(r)>t}function i(e,r,n){var a=[1,0,0],i=Er(zr(e),zr(r)),o=Rr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&e;var c=t*o/s,u=-t*l/s,f=Er(a,i),d=Nr(a,c);Ir(d,Nr(i,u));var p=f,h=Rr(d,p),g=Rr(p,p),v=h*h-g*(Rr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Nr(p,(-h-m)/g);if(Ir(x,d),x=jr(x),!n)return x;var b,_=e[0],w=r[0],k=e[1],M=r[1];w<_&&(b=_,_=w,w=b);var T=w-_,A=y(T-Te)0^x[1]<(y(x[0]-_)Te^(_<=x[0]&&x[0]<=w)){var L=Nr(p,(-h+m)/g);return Ir(L,d),[x,jr(L)]}}}function o(t,n){var a=r?e:Te-e,i=0;return t<-a?i|=1:t>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}((b=+e)*Ce),T()):b},w.clipExtent=function(e){return arguments.length?(_=e,x=e?on(e[0][0],e[0][1],e[1][0],e[1][1]):O,T()):_},w.scale=function(e){return arguments.length?(c=+e,M()):c},w.translate=function(e){return arguments.length?(u=+e[0],f=+e[1],M()):[u,f]},w.center=function(e){return arguments.length?(d=e[0]%360*Ce,p=e[1]%360*Ce,M()):[d*Pe,p*Pe]},w.rotate=function(e){return arguments.length?(h=e[0]%360*Ce,g=e[1]%360*Ce,v=e.length>2?e[2]%360*Ce:0,M()):[h*Pe,g*Pe,v*Pe]},e.rebind(w,s,"precision"),function(){return r=t.apply(this,arguments),w.invert=r.invert&&k,M()}}function Dn(e){return Cn(e,function(t,r){e.point(t*Ce,r*Ce)})}function zn(e,t){return[e,t]}function Rn(e,t){return[e>Te?e-Ae:e<-Te?e+Ae:e,t]}function En(e,t,r){return e?t||r?Yr(Nn(e),Fn(t,r)):Nn(e):t||r?Fn(t,r):Rn}function In(e){return function(t,r){return[(t+=e)>Te?t-Ae:t<-Te?t+Ae:t,r]}}function Nn(e){var t=In(e);return t.invert=In(-e),t}function Fn(e,t){var r=Math.cos(e),n=Math.sin(e),a=Math.cos(t),i=Math.sin(t);function o(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),Re(u*a+s*i)]}return o.invert=function(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),Re(u*r-l*n)]},o}function jn(e,t){var r=Math.cos(e),n=Math.sin(e);return function(a,i,o,l){var s=o*t;null!=a?(a=Bn(r,a),i=Bn(r,i),(o>0?ai)&&(a+=o*Ae)):(a=e+o*Ae,i=e-.5*s);for(var c,u=a;o>0?u>i:u2?e[2]*Ce:0),t.invert=function(t){return(t=e.invert(t[0]*Ce,t[1]*Ce))[0]*=Pe,t[1]*=Pe,t},t},Rn.invert=zn,e.geo.circle=function(){var e,t,r=[0,0],n=6;function a(){var e="function"==typeof r?r.apply(this,arguments):r,n=En(-e[0]*Ce,-e[1]*Ce,0).invert,a=[];return t(null,null,1,{point:function(e,t){a.push(e=n(e,t)),e[0]*=Pe,e[1]*=Pe}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(e){return arguments.length?(r=e,a):r},a.angle=function(r){return arguments.length?(t=jn((e=+r)*Ce,n*Ce),a):e},a.precision=function(r){return arguments.length?(t=jn(e*Ce,(n=+r)*Ce),a):n},a.angle(90)},e.geo.distance=function(e,t){var r,n=(t[0]-e[0])*Ce,a=e[1]*Ce,i=t[1]*Ce,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)},e.geo.graticule=function(){var t,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 e.range(Math.ceil(a/g)*g,n,g).map(f).concat(e.range(Math.ceil(s/v)*v,l,v).map(d)).concat(e.range(Math.ceil(r/p)*p,t,p).filter(function(e){return y(e%g)>ke}).map(c)).concat(e.range(Math.ceil(o/h)*h,i,h).filter(function(e){return y(e%v)>ke}).map(u))}return x.lines=function(){return b().map(function(e){return{type:"LineString",coordinates:e}})},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(e){return arguments.length?x.majorExtent(e).minorExtent(e):x.minorExtent()},x.majorExtent=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],s=+e[0][1],l=+e[1][1],a>n&&(e=a,a=n,n=e),s>l&&(e=s,s=l,l=e),x.precision(m)):[[a,s],[n,l]]},x.minorExtent=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],r>t&&(e=r,r=t,t=e),o>i&&(e=o,o=i,i=e),x.precision(m)):[[r,o],[t,i]]},x.step=function(e){return arguments.length?x.majorStep(e).minorStep(e):x.minorStep()},x.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],x):[g,v]},x.minorStep=function(e){return arguments.length?(p=+e[0],h=+e[1],x):[p,h]},x.precision=function(e){return arguments.length?(m=+e,c=Hn(o,i,90),u=qn(r,t,m),f=Hn(s,l,90),d=qn(a,n,m),x):m},x.majorExtent([[-180,-90+ke],[180,90-ke]]).minorExtent([[-180,-80-ke],[180,80+ke]])},e.geo.greatArc=function(){var t,r,n=Gn,a=Vn;function i(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return e.geo.distance(t||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,i):n},i.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,i):a},i.precision=function(){return arguments.length?i:0},i},e.geo.interpolate=function(e,t){return r=e[0]*Ce,n=e[1]*Ce,a=t[0]*Ce,i=t[1]*Ce,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(Ie(i-n)+o*s*Ie(a-r))),g=1/Math.sin(h),(v=h?function(e){var t=Math.sin(e*=h)*g,r=Math.sin(h-e)*g,n=r*u+t*d,a=r*f+t*p,i=r*l+t*c;return[Math.atan2(a,n)*Pe,Math.atan2(i,Math.sqrt(n*n+a*a))*Pe]}:function(){return[r*Pe,n*Pe]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},e.geo.length=function(t){return bn=0,e.geo.stream(t,Un),bn};var Un={sphere:E,point:E,lineStart:function(){var e,t,r;function n(n,a){var i=Math.sin(a*=Ce),o=Math.cos(a),l=y((n*=Ce)-e),s=Math.cos(l);bn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-t*o*s)*l),t*i+r*o*s),e=n,t=i,r=o}Un.point=function(a,i){e=a*Ce,t=Math.sin(i*=Ce),r=Math.cos(i),Un.point=n},Un.lineEnd=function(){Un.point=Un.lineEnd=E}},lineEnd:E,polygonStart:E,polygonEnd:E};function Zn(e,t){function r(t,r){var n=Math.cos(t),a=Math.cos(r),i=e(n*a);return[i*a*Math.sin(t),i*Math.sin(r)]}return r.invert=function(e,r){var n=Math.sqrt(e*e+r*r),a=t(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(e*i,n*o),Math.asin(n&&r*i/n)]},r}var Yn=Zn(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(e.geo.azimuthalEqualArea=function(){return Pn(Yn)}).raw=Yn;var Xn=Zn(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},O);function Wn(e,t){var r=Math.cos(e),n=function(e){return Math.tan(Te/4+e/2)},a=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(n(t)/n(e)),i=r*Math.pow(n(e),a)/a;if(!a)return $n;function o(e,t){i>0?t<-Se+ke&&(t=-Se+ke):t>Se-ke&&(t=Se-ke);var r=i/Math.pow(n(t),a);return[r*Math.sin(a*e),i-r*Math.cos(a*e)]}return o.invert=function(e,t){var r=i-t,n=Oe(a)*Math.sqrt(e*e+r*r);return[Math.atan2(e,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Se]},o}function Jn(e,t){var r=Math.cos(e),n=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),a=r/n+e;if(y(n)1&&De(e[r[n-2]],e[r[n-1]],e[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function oa(e,t){return e[0]-t[0]||e[1]-t[1]}(e.geo.stereographic=function(){return Pn(ta)}).raw=ta,ra.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Se]},(e.geo.transverseMercator=function(){var e=Kn(ra),t=e.center,r=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90])}).raw=ra,e.geom={},e.geom.hull=function(e){var t=na,r=aa;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=vt(t),i=vt(r),o=e.length,l=[],s=[];for(n=0;n=0;--n)p.push(e[l[c[n]][2]]);for(n=+f;nke)l=l.L;else{if(!((a=i-Ma(l,o))>ke)){n>-ke?(t=l.P,r=l):a>-ke?(t=l,r=l.N):t=r=l;break}if(!l.R){t=l;break}l=l.R}var s=xa(e);if(pa.insert(t,s),t||r){if(t===r)return Ca(t),r=xa(t.site),pa.insert(s,r),s.edge=r.edge=Da(t.site,s.site),Sa(t),void Sa(r);if(r){Ca(t),Ca(r);var c=t.site,u=c.x,f=c.y,d=e.x-u,p=e.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};za(r.edge,c,h,b),s.edge=Da(c,e,null,b),r.edge=Da(e,h,null,b),Sa(t),Sa(r)}else s.edge=Da(t.site,s.site)}}function ka(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-t;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 Ma(e,t){var r=e.N;if(r)return ka(r,t);var n=e.site;return n.y===t?n.x:1/0}function Ta(e){this.site=e,this.edges=[]}function Aa(e,t){return t.angle-e.angle}function La(){Ia(this),this.x=this.y=this.arc=this.site=this.cy=null}function Sa(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.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>=-Me)){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=ma.pop()||new La;m.arc=e,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,e.circle=m;for(var y=null,x=ga._;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.xke||y(a-r)>ke)&&(l.splice(o,0,new Ra((m=i.site,x=u,b=y(n-f)ke?{x:f,y:y(t-f)ke?{x:y(r-h)ke?{x:d,y:y(t-d)ke?{x:y(r-p)=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[l]}),t}function l(e){return e.map(function(e,t){return{x:Math.round(n(e,t)/ke)*ke,y:Math.round(a(e,t)/ke)*ke,i:t}})}return o.links=function(e){return Ba(l(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return Ba(l(e)).cells.forEach(function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Aa),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++ui&&(a=t.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:Ya(r,n)})),i=Ja.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,k=v-h;function M(e,t,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(y(s-r)+y(c-n)<.01)T(e,t,r,n,a,i,o,l);else{var u=e.point;e.x=e.y=e.point=null,T(e,u,s,c,a,i,o,l),T(e,t,r,n,a,i,o,l)}else e.x=r,e.y=n,e.point=t}else T(e,t,r,n,a,i,o,l)}function T(e,t,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;e.leaf=!1,u?a=s:o=s,f?i=c:l=c,M(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,a,i,o,l)}w>k?v=h+w:g=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){M(A,e,+m(e,++f),+x(e,f),p,h,g,v)}};if(A.visit=function(e){!function e(t,r,n,a,i,o){if(!t(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&e(t,c[0],n,a,l,s),c[1]&&e(t,c[1],l,a,i,s),c[2]&&e(t,c[2],n,s,l,o),c[3]&&e(t,c[3],l,s,i,o)}}(e,A,p,h,g,v)},A.find=function(e){return function(e,t,r,n,a,i,o){var l,s=1/0;return function e(c,u,f,d,p){if(!(u>i||f>o||d=_)<<1|t>=b,k=w+4;w=0&&!(n=e.interpolators[a](t,r)););return n}function $a(e,t){var r,n=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function li(e){return 1-Math.cos(e*Se)}function si(e){return Math.pow(2,10*(e-1))}function ci(e){return 1-Math.sqrt(1-e*e)}function ui(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function fi(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function di(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=hi(a),l=pi(a,i),s=hi(((t=i)[0]+=(n=-l)*(r=a)[0],t[1]+=n*r[1],t))||0;a[0]*i[1]=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return a=ei.get(a)||Ka,i=ti.get(i)||O,t=i(a.apply(null,r.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.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(e){return Ye(n+o*e,a+l*e,i+s*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.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(e){return Ve(n+o*e,a+l*e,i+s*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(e){return et(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=fi,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new di(t?t.matrix:gi)})(t)},di.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gi={a:1,b:0,c:0,d:1,e:0,f:0};function vi(e){return e.length?e.pop()+",":""}function mi(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Ya(e[0],t[0])},{i:a-2,x:Ya(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(vi(r)+"rotate(",null,")")-2,x:Ya(e,t)})):t&&r.push(vi(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(vi(r)+"skewX(",null,")")-2,x:Ya(e,t)}):t&&r.push(vi(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(vi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Ya(e[0],t[0])},{i:a-2,x:Ya(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(vi(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=Mt(l.tick)),l):n},l.start=function(){var e,t,r,n=m.length,s=y.length,u=c[0],h=c[1];for(e=0;e=0;)r.push(a[n])}function Oi(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.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 Oi(a,function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)}),l}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Pi(e,function(e){e.children&&(e.value=0)}),Oi(e,function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=t.value?n/t.value:0;++cl&&(l=n),o.push(n)}for(r=0;ra&&(n=r,a=t);return n}function Ui(e){return e.reduce(Zi,0)}function Zi(e,t){return e+t[1]}function Yi(e,t){return Xi(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Xi(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function Wi(t){return[e.min(t),e.max(t)]}function Ji(e,t){return e.value-t.value}function Qi(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function $i(e,t){e._pack_next=t,t._pack_prev=e}function Ki(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function eo(e){if((t=e.children)&&(s=t.length)){var t,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(t.forEach(to),(r=t[0]).x=-r.r,r.y=0,x(r),s>1&&((n=t[1]).x=n.r,n.y=0,x(n),s>2))for(no(r,n,a=t[2]),x(a),Qi(r,a),r._pack_prev=a,Qi(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&s<=f[1]&&((l=c[e.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=vt(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return Xi(t,e)}:vt(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(Ji),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),l=o[0],s=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,Oi(l,function(e){e.r=+u(e.value)}),Oi(l,eo),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;Oi(l,function(e){e.r+=f}),Oi(l,eo),Oi(l,function(e){e.r-=f})}return function e(t,r,n,a){var i=t.children;t.x=r+=a*t.x;t.y=n+=a*t.y;t.r*=a;if(i)for(var o=-1,l=i.length;++op.x&&(p=e),e.depth>h.depth&&(h=e)});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(e){e.x=(e.x+g)*v,e.y=e.depth*m})}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){var t,r=0,n=0,a=e.children,i=a.length;for(;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,l=t,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=oo(l),i=io(i),l&&i;)s=io(s),(o=oo(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(lo(so(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!oo(o)&&(o.t=l,o.m+=f-u),i&&!io(s)&&(s.t=i,s.m+=c-d,n=e)}return n}(e,a,e.parent.A||n[0])}function l(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?s:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:s,i):a?n:null},Ci(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=ao,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;Oi(c,function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}(n),t.y=function(t){return 1+e.max(t,function(e){return e.y})}(n)):(t.x=l?u+=r(t,l):0,t.y=0,l=t)});var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),d=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Oi(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),s}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},Ci(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=co,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.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),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.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);t.forEach(d)}}function p(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,l=e.length;++oa&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function h(e,t,r,a){var i,o=-1,l=e.length,s=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?yo:ho,l=a?xi:yi;return i=e(t,r,l,n),o=e(r,t,l,Qa),s}function s(e){return i(e)}s.invert=function(e){return o(e)};s.domain=function(e){return arguments.length?(t=e.map(Number),l()):t};s.range=function(e){return arguments.length?(r=e,l()):r};s.rangeRound=function(e){return s.range(e).interpolate(fi)};s.clamp=function(e){return arguments.length?(a=e,l()):a};s.interpolate=function(e){return arguments.length?(n=e,l()):n};s.ticks=function(e){return wo(t,e)};s.tickFormat=function(e,r){return ko(t,e,r)};s.nice=function(e){return bo(t,e),l()};s.copy=function(){return e(t,r,n,a)};return l()}([0,1],[0,1],Qa,!1)};var Mo={s:1,g:1,p:1,r:1,e:1};function To(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}e.scale.log=function(){return function t(r,n,a,i){function o(e){return(a?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function l(e){return a?Math.pow(n,e):-Math.pow(n,-e)}function s(e){return r(o(e))}s.invert=function(e){return l(r.invert(e))};s.domain=function(e){return arguments.length?(a=e[0]>=0,r.domain((i=e.map(Number)).map(o)),s):i};s.base=function(e){return arguments.length?(n=+e,r.domain(i.map(o)),s):n};s.nice=function(){var e=go(i.map(o),a?Math:Lo);return r.domain(e),i=e.map(l),s};s.ticks=function(){var e=fo(i),t=[],r=e[0],s=e[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--)t.push(l(c)*d);for(c=0;t[c]s;u--);t=t.slice(c,u)}return t};s.tickFormat=function(t,r){if(!arguments.length)return Ao;arguments.length<2?r=Ao:"function"!=typeof r&&(r=e.format(r));var a=Math.max(1,n*t/s.ticks().length);return function(e){var t=e/l(Math.round(o(e)));return t*n0?a[e-1]:r[0],ef?0:1;if(c=Le)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,k,M,T,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Ro?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Re(v/c*Math.sin(m))),l&&(A=Re(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)<=Te?0:1;if(L&&Bo(y,x,b,_)===p^C){var P=(u+f)/2;y=c*Math.cos(P),x=c*Math.sin(P),b=_=null}}else y=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),M=l*Math.cos(u+A),T=l*Math.sin(u+A);var O=Math.abs(u-f+2*A)<=Te?0:1;if(A&&Bo(w,k,M,T)===1-p^O){var D=(u+f)/2;w=l*Math.cos(D),k=l*Math.sin(D),M=T=null}}else w=k=0;if(d>ke&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l0?0:1}function Ho(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=e[0]+s,f=e[1]+c,d=t[0]+s,p=t[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,k=(-b*v-m*_)/y,M=(b*m+v*_)/y,T=(-b*v+m*_)/y,A=w-h,L=k-g,S=M-h,C=T-g;return A*A+L*L>S*S+C*C&&(w=M,k=T),[[w-s,k-c],[w*r/x,k*r/x]]}function qo(e){var t=na,r=aa,n=Xr,a=Vo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=vt(t),p=vt(r);function h(){s.push("M",a(e(c),o))}for(;++u1&&a.push("H",n[0]);return a.join("")},"step-before":Zo,"step-after":Yo,basis:Jo,"basis-open":function(e){if(e.length<4)return Vo(e);var t,r=[],n=-1,a=e.length,i=[0],o=[0];for(;++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);r.push(Qo(el,i)+","+Qo(el,o)),--n;for(;++n9&&(a=3*t/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(e))}});function Vo(e){return e.length>1?e.join("L"):e+"Z"}function Uo(e){return e.join("L")+"Z"}function Zo(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t1){l=t[1],i=e[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;cTe)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=vt(e),i):r},i.source=function(t){return arguments.length?(e=vt(t),i):e},i.target=function(e){return arguments.length?(t=vt(e),i):t},i.startAngle=function(e){return arguments.length?(n=vt(e),i):n},i.endAngle=function(e){return arguments.length?(a=vt(e),i):a},i},e.svg.diagonal=function(){var e=Gn,t=Vn,r=ol;function n(n,a){var i=e.call(this,n,a),o=t.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(t){return arguments.length?(e=vt(t),n):e},n.target=function(e){return arguments.length?(t=vt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=ol,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Se;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=sl,t=ll;function r(r,n){return(ul.get(e.call(this,r,n))||cl)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=vt(t),r):e},r.size=function(e){return arguments.length?(t=vt(e),r):t},r};var ul=e.map({circle:cl,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*dl)),r=t*dl;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/fl),r=t*fl/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/fl),r=t*fl/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=ul.keys();var fl=Math.sqrt(3),dl=Math.tan(30*Ce);Y.transition=function(e){for(var t,r,n=vl||++xl,a=wl(e),i=[],o=ml||{time:Date.now(),ease:oi,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=Mt(function(e){var t=f.delay;if(o.t=t+i,t<=e)return d(e-t);o.c=d},0,i),f=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}yl.call=Y.call,yl.empty=Y.empty,yl.node=Y.node,yl.size=Y.size,e.transition=function(t,r){return t&&t.transition?vl?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=yl,yl.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=X(e);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=e.select(e.event.target),x=n.of(m,arguments),b=e.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,M=y.classed("extent"),T=xe(m),A=e.mouse(m),L=e.select(o(m)).on("keydown.brush",function(){32==e.event.keyCode&&(M||(f=null,A[0]-=l[1],A[1]-=s[1],M=2),F())}).on("keyup.brush",function(){32==e.event.keyCode&&2==M&&(A[0]+=l[1],A[1]+=s[1],M=0,F())});if(e.event.changedTouches?L.on("touchmove.brush",P).on("touchend.brush",D):L.on("mousemove.brush",P).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),M)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 e.event.altKey&&(f=A.slice());function P(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),M||(e.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(t[0]1?{floor:function(t){for(;l(t=e.floor(t));)t=El(t-1);return t},ceil:function(t){for(;l(t=e.ceil(t));)t=El(+t+1);return t}}:e))},a.ticks=function(e,t){var r=fo(a.domain()),n=null==e?i(r,10):"number"==typeof e?i(r,e):!e.range&&[{range:e},t];return n&&(e=n[0],t=n[1]),e.range(r[0],El(+r[1]+1),t<1?1:t)},a.tickFormat=function(){return n},a.copy=function(){return Rl(t.copy(),r,n)},xo(a,t)}function El(e){return new Date(e)}Pl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?zl:Dl,zl.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},zl.toString=Dl.toString,Rt.second=Ft(function(e){return new Et(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),Rt.seconds=Rt.second.range,Rt.seconds.utc=Rt.second.utc.range,Rt.minute=Ft(function(e){return new Et(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),Rt.minutes=Rt.minute.range,Rt.minutes.utc=Rt.minute.utc.range,Rt.hour=Ft(function(e){var t=e.getTimezoneOffset()/60;return new Et(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),Rt.hours=Rt.hour.range,Rt.hours.utc=Rt.hour.utc.range,Rt.month=Ft(function(e){return(e=Rt.day(e)).setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),Rt.months=Rt.month.range,Rt.months.utc=Rt.month.utc.range;var Il=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Nl=[[Rt.second,1],[Rt.second,5],[Rt.second,15],[Rt.second,30],[Rt.minute,1],[Rt.minute,5],[Rt.minute,15],[Rt.minute,30],[Rt.hour,1],[Rt.hour,3],[Rt.hour,6],[Rt.hour,12],[Rt.day,1],[Rt.day,2],[Rt.week,1],[Rt.month,1],[Rt.month,3],[Rt.year,1]],Fl=Pl.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Xr]]),jl={range:function(t,r,n){return e.range(Math.ceil(t/n)*n,+r,n).map(El)},floor:O,ceil:O};Nl.year=Rt.year,Rt.scale=function(){return Rl(e.scale.linear(),Nl,Fl)};var Bl=Nl.map(function(e){return[e[0].utc,e[1]]}),Hl=Ol.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Xr]]);function ql(e){return JSON.parse(e.responseText)}function Gl(e){var t=a.createRange();return t.selectNode(a.body),t.createContextualFragment(e.responseText)}Bl.year=Rt.year.utc,Rt.scale.utc=function(){return Rl(e.scale.linear(),Bl,Hl)},e.text=mt(function(e){return e.responseText}),e.json=function(e,t){return yt(e,"application/json",ql,t)},e.html=function(e,t){return yt(e,"text/html",Gl,t)},e.xml=mt(function(e){return e.responseXML}),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}()},{}],14:[function(e,t,r){(function(n,a){!function(e,n){"object"==typeof r&&"undefined"!=typeof t?t.exports=n():e.ES6Promise=n()}(this,function(){"use strict";function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,o=void 0,l=void 0,s=function(e,t){g[i]=e,g[i+1]=t,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 e=setTimeout;return function(){return e(v,1)}}var g=new Array(1e3);function v(){for(var e=0;e13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],21:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a=e.clientX||0,i=e.clientY||0,o=(l=t,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],22:[function(e,t,r){var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":23,"./lib/epsilon":24,"./lib/geojson":25,"./lib/intersecter":26,"./lib/segment-chainer":28,"./lib/segment-selector":29}],23:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],24:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],25:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0})}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y,x=v();if(x)e?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(x.seg),d.other.remove(),d.remove();if(i.getHead()!==d){r&&r.rewind(d.seg);continue}e?(y=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=y?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m}),r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(E(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function O(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function E(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],32:[function(e,t,r){var n;n=this,function(e){"use strict";var t=function(e){return e},r=function(e){if(null==(r=e.transform))return t;var r,n,a,i=r.scale[0],o=r.scale[1],l=r.translate[0],s=r.translate[1];return function(e,t){return t||(n=a=0),e[0]=(n+=e[0])*i+l,e[1]=(a+=e[1])*o+s,e}},n=function(e){var t=e.bbox;function n(e){s[0]=e[0],s[1]=e[1],l(s),s[0]f&&(f=s[0]),s[1]d&&(d=s[1])}function a(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(a);break;case"Point":n(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(n)}}if(!t){var i,o,l=r(e),s=new Array(2),c=1/0,u=c,f=-c,d=-c;for(o in e.arcs.forEach(function(e){for(var t=-1,r=e.length;++tf&&(f=s[0]),s[1]d&&(d=s[1])}),e.objects)a(e.objects[o]);t=e.bbox=[c,u,f,d]}return t},a=function(e,t){for(var r,n=e.length,a=n-t;a<--n;)r=e[a],e[a++]=e[n],e[n]=r};function i(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,i=o(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:i}:null==n?{type:"Feature",id:r,properties:a,geometry:i}:{type:"Feature",id:r,bbox:n,properties:a,geometry:i}}function o(e,t){var n=r(e),i=e.arcs;function o(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],o=0,l=r.length;o1)n=function(e,t,r){var n,a=[],i=[];function o(e){var t=e<0?~e:e;(i[t]||(i[t]=[])).push({i:e,g:n})}function l(e){e.forEach(o)}function s(e){e.forEach(l)}return function e(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":l(t.arcs);break;case"MultiLineString":case"Polygon":s(t.arcs);break;case"MultiPolygon":t.arcs.forEach(s)}}(t),i.forEach(null==r?function(e){a.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&a.push(e[0].i)}),a}(0,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,o,c=1,u=s(a[0]);cu&&(o=a[0],a[0]=a[c],a[c]=o,u=i);return a})}}var u=function(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");if(e.transform)throw new Error("already quantized");var r,a=n(e),i=a[0],o=(a[2]-i)/(t-1)||1,l=a[1],s=(a[3]-l)/(t-1)||1;function c(e){e[0]=Math.round((e[0]-i)/o),e[1]=Math.round((e[1]-l)/s)}function u(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"Point":c(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(c)}}for(r in e.arcs.forEach(function(e){for(var t,r,n,a=1,c=1,u=e.length,f=e[0],d=f[0]=Math.round((f[0]-i)/o),p=f[1]=Math.round((f[1]-l)/s);a0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var V=!1,U=["x","y"],Z=0;Z1)&&(ee===K?((ce=te.r2fraction(t["a"+$]))<0||ce>1)&&(V=!0):V=!0),Y=te._offset+te.r2p(t[$]),J=.5}else"x"===$?(W=t[$],Y=b.l+b.w*W):(W=1-t[$],Y=b.t+b.h*W),J=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+$];Q=ne*H(.5,t.xanchor)-ae*H(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=Q):(se.tail=Y+ue,X=Q+ue),se.text=se.tail+Q;var fe=x["x"===$?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=Q=ie*H(J,oe),se.text=Y+Q;se.text+=le,Q+=le,X+=le,t["_"+$+"padplus"]=ie/2+X,t["_"+$+"padminus"]=ie/2-X,t["_"+$+"size"]=ie,t["_"+$+"shift"]=Q}if(V)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,F?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;q.call(f.positionText,me,ve).call(c.setClipUrl,F?A:null,e)}j.select("rect").call(c.setRect,I,I,w,D),N.call(c.setRect,R/2,R/2,E-R,B-R),z.call(c.setTranslate,Math.round(L.x.text-E/2),Math.round(L.y.text-B/2)),P.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),O=+N.attr("width"),D=+N.attr("height"),R=m-.5*O,E=R+O,I=y-.5*D,F=I+D,j=[[R,I,R,F],[R,F,E,F],[E,F,E,I],[E,I,R,I]].map(A);if(!j.reduce(function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])},!1)){j.forEach(function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)});var B=t.arrowwidth,H=t.arrowcolor,q=t.arrowside,G=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),V=G.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",B+"px").call(s.stroke,s.rgb(H));if(g(V,q,t),_.annotationPosition&&V.node().parentNode&&!i){var U=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));U+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-U)+","+(h-Z),transform:"translate("+U+","+Z+")"}).style("stroke-width",B+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),M("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),M("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&M("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&M("ay",v.p2r(v.r2p(t.ay)+r)),G.attr("transform","translate("+e+","+r+")"),P.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),O)p.init({element:z.node(),gd:e,prepFn:function(){ye=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?M("ax",l.p2r(l.r2p(t.ax)+e)):M("ax",t.ax+e),t.ayref===t.yref?M("ay",v.p2r(v.r2p(t.ay)+r)):M("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}M("x",a),M("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}P.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,T());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void O();if(m){if(m*m>x*x+b*b)return void O();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void O();var k=y*Math.cos(s),M=y*Math.sin(s);o.x-=k,o.y-=M,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var T=u.getTotalLength(),A="";if(T1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":249,"../annotations/draw":40}],47:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(U.tick0=0)}U.dtick=Z}U.domain=[q+j,q+I-j],U.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var J,Q=e.select("."+M.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),$=e.select("."+M.cbaxis),K=0;function ee(n,a){var i={propContainer:U,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var e,r=s.l+(t.x+N)*s.w,n=U.title.font.size;e="top"===T?(1-(q+I-j))*s.h+s.t+3+.75*n:(1-(q+j))*s.h+s.t-3-.25*n,ee(U._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var i=e.select("."+M.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+U._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===T)U.domain[1]-=K/s.h,u[1]*=-1;else{U.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),U.setScale()}}e.selectAll("."+M.cbfills+",."+M.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-U.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+M.cbfills).selectAll("rect."+M.cbfill).data(O);m.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(U.c2p).map(Math.round).sort(function(e,t){return e-t});m.each(function(e,i){var o=[0===i?A[0]:(O[i]+O[i-1])/2,i===O.length-1?A[1]:(O[i]+O[i+1])/2].map(U.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:B,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}});var x=e.select("."+M.cblines).selectAll("path."+M.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each(function(e){n.select(this).attr("d","M"+B+","+(Math.round(U.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)}),$.selectAll("g."+U._id+"tick,path").remove();var b=B+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(U),k=l.makeTransFn(U),C=l.getTickSigns(U)[2];return l.drawTicks(r,U,{vals:"inside"===U.ticks?l.clipEnds(U,w):w,layer:$,path:l.makeTickPath(U,b,C),transFn:k}),l.drawLabels(r,U,{vals:w,layer:$,transFn:k,labelFns:l.makeLabelFns(U,b)})},function(){if(-1===["top","bottom"].indexOf(T)){var e=U.title.font.size,t=U._offset+U._length/2,a=s.l+(U.position||0)*s.w+("right"===U.side?10+e*(U.showticklabels?1:.5):-10-e*(U.showticklabels?.5:0));ee("h"+U._id+"title",{avoid:{selection:n.select(r).selectAll("g."+U._id+"tick"),side:T,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox($.node()).width;if((J=Q.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=Q.select(".h"+U._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(T)?d.bBox(o).width:d.bBox(Q.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=G-V;e.select("."+M.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:V-F,width:Math.max(l,2),height:Math.max(c+2*F,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+M.cboutline).attr({x:B,y:V+t.ypad+("top"===T?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)}),t.exit().each(function(t){i.autoMargin(e,t._id)}).remove(),t.order()}}},{"../../constants/alignment":143,"../../lib":168,"../../lib/extend":161,"../../lib/setcursor":187,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":213,"../../plots/cartesian/axis_defaults":215,"../../plots/cartesian/layout_attributes":225,"../../plots/cartesian/position_defaults":228,"../../plots/plots":252,"../../registry":261,"../color":49,"../colorscale/helpers":60,"../dragelement":67,"../drawing":70,"../titles":136,"./constants":51,d3:13,tinycolor2:31}],54:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":168}],55:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":50,"./defaults":52,"./draw":53,"./has_colorbar":54}],56:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":183,"../colorbar/attributes":50,"./scales.js":64}],57:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":168,"./helpers":60,"fast-isnumeric":15}],58:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],66:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":168}],67:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":168,"../../plots/cartesian/constants":219,"./align":65,"./cursor":66,"./unhover":68,"has-hover":17,"has-passive-events":18,"mouse-event-offset":21}],68:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":159,"../../lib/events":160,"../../lib/throttle":190,"../fx/constants":82}],69:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],70:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each(function(e){var a=n.select(this);m.translatePoint(e,a,t,r)})},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each(function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each(function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)})})}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each(function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each(function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)})};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach(function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)});var x=m.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?b:"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=T[a],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each(function(e){m.singlePointStyle(e,n.select(this),t,a,r)})}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",_(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+e.i),m.gradient(t,a,b,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push(function(e,t){e.style("opacity",r.selectedOpacityFn(t))}),r.selectedColorFn&&i.push(function(e,t){l.fill(e,r.selectedColorFn(t))}),r.selectedSizeFn&&i.push(function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",_(m.symbolNumber(n),i)),t.mrc2=i}),i.length&&e.each(function(e){for(var t=n.select(this),r=0;r0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each(function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=S(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(L,h,g,e.mrc)}else i.remove()})}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each(function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=S(e,t);l.fill(a,i),L(a,o,s,e.mrc2||e.mrc)})}};var C=.5;function P(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,C/2),u=Math.pow(l*l+s*s,C/2),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(m.savedBBoxes={},z=0),r&&(m.savedBBoxes[r]=v),z++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",E(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each(function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)})}};var N=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each(function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(N);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}})}},{"../../components/fx/helpers":84,"../../constants/alignment":143,"../../constants/interactions":145,"../../constants/xmlns_namespaces":147,"../../lib":168,"../../lib/svg_text_utils":189,"../../registry":261,"../../traces/scatter/make_bubble_size_func":300,"../../traces/scatter/subtypes":307,"../color":49,"../colorscale":61,"./symbol_defs":71,d3:13,"fast-isnumeric":15,tinycolor2:31}],71:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:13}],72:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],73:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each(function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each(function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}})}})}},{"../../traces/scatter/subtypes":307,"../drawing":70,d3:13,"fast-isnumeric":15}],78:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each(function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":49,d3:13}],79:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":161,"../../plots/font_attributes":239,"./layout_attributes":88}],80:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||K<0||K>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=$+_[0]._offset,t.pointerY=K+w[0]._offset,z="xval"in t?g.flat(s,t.xval):g.p2c(_,$),R="yval"in t?g.flat(s,t.yval):g.p2c(w,K),!a(z[0])||!a(R[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var re=1/0;for(I=0;IU&&(X.splice(0,U),re=X[0].distance),m&&0!==Y&&0===X.length){V.distance=Y,V.index=!1;var le=F._module.hoverPoints(V,q,G,"closest",u._hoverlayer);if(le&&(le=le.filter(function(e){return e.spikeDistance<=Y})),le&&le.length){var se,ce=le.filter(function(e){return e.xa.showspikes});if(ce.length){var ue=ce[0];a(ue.x0)&&a(ue.y0)&&(se=he(ue),(!J.vLinePoint||J.vLinePoint.spikeDistance>se.spikeDistance)&&(J.vLinePoint=se))}var fe=le.filter(function(e){return e.ya.showspikes});if(fe.length){var de=fe[0];a(de.x0)&&a(de.y0)&&(se=he(de),(!J.hLinePoint||J.hLinePoint.spikeDistance>se.spikeDistance)&&(J.hLinePoint=se))}}}}function pe(e,t){for(var r,n=null,a=1/0,i=0;i1||X.length>1)||"closest"===D&&Q&&X.length>1,Ce=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Pe={hovermode:D,rotateLabels:Se,bgColor:Ce,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Oe=T(X,Pe,e);if(function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}for(e.each(function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?x:1)/2,pmin:0,pmax:a?r.width:r.height}]}),p.sort(function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)});!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.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 _=p[o];for(l=_.length-1;l>=0;l--){var w=_[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Oe,Se?"xa":"ya",u),A(Oe,Se),t.target&&t.target.tagName){var De=h.getComponentMethod("annotations","hasClickToShow")(e,Me);c(n.select(t.target),De?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,ke))return;ke&&e.emit("plotly_unhover",{event:t,points:ke});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:z,yvals:R})}(e,t,r,i)})},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map(function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}}),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=T(a,l,t.gd),c=0,u=0;return s.sort(function(e,t){return e.y0-t.y0}).each(function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function T(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},g=t.fontFamily||v.HOVERFONT,y=t.fontSize||v.HOVERFONTSIZE,x=e[0],b=x.xa,_=x.ya,T="y"===i?"yLabel":"xLabel",A=x[T],L=(String(A)||"").split(" ")[0],S=p.node().getBoundingClientRect(),C=S.top,O=S.width,D=S.height,z=void 0!==A&&x.distance<=t.hoverdistance&&("x"===i||"y"===i);if(z){var R,E,I=!0;for(R=0;Ra.width-D?(M=a.width-D,l.attr("d","M"+(D-w)+",0L"+D+","+O+w+"v"+O+(2*k+P.height)+"H-"+D+"V"+O+w+"H"+(D-2*w)+"Z")):l.attr("d","M0,0L"+w+","+O+w+"H"+(k+P.width/2)+"v"+O+(2*k+P.height)+"H-"+(k+P.width/2)+"V"+O+w+"H-"+w+"Z")}else{var z,R,E;"right"===_.side?(z="start",R=1,E="",M=b._offset+b._length):(z="end",R=-1,E="-",M=b._offset),S=_._offset+(x.y0+x.y1)/2,c.attr("text-anchor",z),l.attr("d","M0,0L"+E+w+","+w+"V"+(k+P.height/2)+"h"+E+(2*k+P.width)+"V-"+(k+P.height/2)+"H"+E+w+"V-"+w+"Z");var I,N=P.height/2,F=C-P.top-N,j="clip"+a._uid+"commonlabel"+_._id;if(M"),void 0!==e.yLabel&&(p+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(p+=(p?"z: ":"")+e.zLabel)):z&&e[i+"Label"]===A?p=e[("x"===i?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(p=e.yLabel):p=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(p+=(p?"
":"")+e.text),void 0!==e.extraText&&(p+=(p?"
":"")+e.extraText),""!==p||e.hovertemplate||(""===d&&t.remove(),p=d);var _=a._d3locale,T=e.hovertemplate||!1,L=e.hovertemplateLabels||e,S=e.eventData[0]||{};T&&(p=(p=o.hovertemplateString(T,L,_,S,e.trace._meta)).replace(M,function(t,r){return d=P(r,e.nameLength),""}));var R=t.select("text.nums").call(u.font,e.fontFamily||g,e.fontSize||y,e.fontColor||b).text(p).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),E=t.select("text.name"),I=0,N=0;if(d&&d!==p){E.call(u.font,e.fontFamily||g,e.fontSize||y,x).text(d).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var F=E.node().getBoundingClientRect();I=F.width+2*k,N=F.height+2*k}else E.remove(),t.select("rect").remove();t.select("path").style({fill:v,stroke:b});var j,B,H=R.node().getBoundingClientRect(),q=e.xa._offset+(e.x0+e.x1)/2,G=e.ya._offset+(e.y0+e.y1)/2,V=Math.abs(e.x1-e.x0),U=Math.abs(e.y1-e.y0),Z=H.width+w+k+I;if(e.ty0=C-H.top,e.bx=H.width+2*k,e.by=Math.max(H.height+2*k,N),e.anchor="start",e.txwidth=H.width,e.tx2width=I,e.offset=0,l)e.pos=q,j=G+U/2+Z<=D,B=G-U/2-Z>=0,"top"!==e.idealAlign&&j||!B?j?(G+=U/2,e.anchor="start"):e.anchor="middle":(G-=U/2,e.anchor="end");else if(e.pos=G,j=q+V/2+Z<=O,B=q-V/2-Z>=0,"left"!==e.idealAlign&&j||!B)if(j)q+=V/2,e.anchor="start";else{e.anchor="middle";var Y=Z/2,X=q+Y-O,W=q-Y;X>0&&(q-=X),W<0&&(q+=-W)}else q-=V/2,e.anchor="end";R.attr("text-anchor",e.anchor),I&&E.attr("text-anchor",e.anchor),t.attr("transform","translate("+q+","+G+")"+(l?"rotate("+m+")":""))}),j}function A(e,t){e.each(function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(w+k),f=c+l*(e.txwidth+k),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+k),t&&(p*=-_,d=e.offset*b),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*w+d)+","+(w+p)+"v"+(e.by/2-w)+"h"+o*e.bx+"v-"+e.by+"H"+(o*w+d)+"V"+(p-w)+"Z");var h=c+d,g=p+e.ty0-e.by/2+k,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+k:-e.bx-k):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-k:e.bx+k)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*k+d,p+e.ty0-e.by/2+k),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))})}function L(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function S(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,M=a.spikecolor||_,T=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=T,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:M,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?k:-k),cy:m,r:k,fill:M}).classed("spikeline",!0)}if(h){var S,C,P=t.vLinePoint;n=P&&P.xa,a=P&&P.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+P.x,C=a._offset+P.y);var O,D,z=i.readability(P.color,g)<1.5?f.contrast(g):P.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,N=p.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(O=N,D=C),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=s.t+(1-j)*s.h,D=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":E+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?E:-E),r:E,fill:I}).classed("spikeline",!0)}}}function C(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function P(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":168,"../../lib/events":160,"../../lib/override_cursor":179,"../../lib/svg_text_utils":189,"../../plots/cartesian/axes":213,"../../registry":261,"../color":49,"../dragelement":67,"../drawing":70,"./constants":82,"./helpers":84,d3:13,"fast-isnumeric":15,tinycolor2:31}],86:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r,a){r("hoverlabel.bgcolor",(a=a||{}).bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font),r("hoverlabel.align",a.align)}},{"../../lib":168}],87:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)})},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":168,"../dragelement":67,"./attributes":79,"./calc":80,"./click":81,"./constants":82,"./defaults":83,"./helpers":84,"./hover":85,"./layout_attributes":88,"./layout_defaults":89,"./layout_global_defaults":90,d3:13}],88:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":239,"./constants":82}],89:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return n.coerce(e,t,a,r,i)}var o,l=i("clickmode");"select"===i("dragmode")&&i("selectdirection"),t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n1){d||p||h||"independent"===M("pattern")&&(d=!0),v._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",M,w,x,y),y:u("y",M,k,b,m,_)}}else delete t.grid}function M(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":168,"../../plot_api/plot_template":203,"../../plots/layout_attributes":250,"../../registry":261,"./attributes":97,"./helpers":103}],100:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout(function(){d(r,e,n)},e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t){var r=e.data()[0][0],n=t._fullLayout.legend,i=r.trace,l=o.traceIs(i,"pie-like"),s=i.index,u=t._context.edits.legendText&&!l,d=n._maxNameLength,h=l?r.label:i.name;i._meta&&(h=a.templateString(h,i._meta));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,n.font).text(u?k(h,d):h),f.positionText(g,p.textGap,0),u?g.call(f.makeEditable,{gd:t,text:h}).call(T,e,t).on("edit",function(n){this.text(k(n,d)).call(T,e,t);var i=r.trace._fullInput||{},l={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),u=c[c.length-1],f=a.keyedContainer(i,"transforms["+u+"].styles","target","value.name");f.set(r.trace._group,n),l=f.constructUpdate()}else l.name=n;return o.call("_guiRestyle",t,l,s)}):T(g,e,t)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});l.on("mousedown",function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})}function T(e,t,r){f.convertToTspans(e,r,function(){!function(e,t){var r=e.data()[0][0];if(r&&!r.trace.showlegend)return void e.remove();var n,a,i=e.select("g[class*=math-group]"),o=i.node(),l=t._fullLayout.legend.borderwidth,s=t._fullLayout.legend,u=(r?s:s.title).font.size*g;if(o){var d=c.bBox(o);n=d.height,a=d.width,r?c.setTranslate(i,0,.25*n):c.setTranslate(i,l,.75*n+l)}else{var h=e.select(r?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();n=u*v,a=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);r?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+l,u+l)}r?(r.lineHeight=u,r.height=Math.max(n,16)+3,r.width=a):(s._titleWidth=a,s._titleHeight=n)}(t,r)})}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e){var t=e._fullLayout,r="legend"+t._uid;if(t._infolayer&&e.calcdata){e._legendMouseDownTime||(e._legendMouseDownTime=0);var l=t.legend,f=t.showlegend&&y(e.calcdata,l),d=t.hiddenlabels||[];if(!t.showlegend||!f.length)return t._infolayer.selectAll(".legend").remove(),t._topdefs.select("#"+r).remove(),i.autoMargin(e,"legend");var h=a.ensureSingle(t._infolayer,"g","legend",function(e){e.attr("pointer-events","all")}),g=a.ensureSingleById(t._topdefs,"clipPath",r,function(e){e.append("rect")}),k=a.ensureSingle(h,"rect","bg",function(e){e.attr("shape-rendering","crispEdges")});k.call(u.stroke,l.bordercolor).call(u.fill,l.bgcolor).style("stroke-width",l.borderwidth+"px");var S=a.ensureSingle(h,"g","scrollbox"),C=l.title;if(l._titleWidth=0,l._titleHeight=0,C.text){var P=a.ensureSingle(S,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,C.font).text(C.text),T(P,S,e)}var O=a.ensureSingle(h,"rect","scrollbar",function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)}),D=S.selectAll("g.groups").data(f);D.enter().append("g").attr("class","groups"),D.exit().remove();var z=D.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==d.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1}).each(function(){n.select(this).call(w,e)}).call(x,e).each(function(){n.select(this).call(M,e)}),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r){var a=e._fullLayout,i=a.legend,o=a._size,l=b.isVertical(i),s=b.isGrouped(i),u=i.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(i),m=i.y<0||0===i.y&&"top"===v,y=i.y>1||1===i.y&&"bottom"===v;i._maxHeight=Math.max(m||y?a.height/2:o.h,30);var x=0;i._width=0,i._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(i);if(l)r.each(function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+i._height+t/2+h),i._height+=t,i._width=Math.max(i._width,e[0].width)}),x=d+i._width,i._width+=h+d+f,i._height+=g,s&&(t.each(function(e,t){c.setTranslate(this,0,t*i.tracegroupgap)}),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=A(i),k=i.x<0||0===i.x&&"right"===w,M=i.x>1||1===i.x&&"left"===w,T=y||m,S=a.width/2;i._maxWidth=Math.max(k?T&&"left"===w?o.l+o.w:S:M?T&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,P=0;r.each(function(e){var t=e[0].width+d;C=Math.max(C,t),P+=t}),x=null;var O=0;if(s){var D=0,z=0,R=0;t.each(function(){var e=0,t=0;n.select(this).selectAll("g.traces").each(function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)}),D=Math.max(D,t);var r=e+h;r+u+z>i._maxWidth&&(O=Math.max(O,z),z=0,R+=D+i.tracegroupgap,D=t),c.setTranslate(this,z,R),z+=r}),i._width=Math.max(O,z)+u,i._height=R+D+g}else{var E=r.size(),I=P+f+(E-1)*hi._maxWidth&&(O=Math.max(O,B),F=0,j+=N,i._height+=N,N=0),c.setTranslate(this,_[0]+u+F,_[1]+u+j+t/2+h),B=F+r+h,F+=n,N=Math.max(N,t)}),I?(i._width=F+f,i._height=N+g):(i._width=Math.max(O,B)+f,i._height+=N+g)}}i._width=Math.ceil(Math.max(i._width+_[0],i._titleWidth+2*(u+p.titlePad))),i._height=Math.ceil(Math.max(i._height+_[1],i._titleHeight+2*(u+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var H=e._context.edits,q=H.legendText||H.legendPosition;r.each(function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=q?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)})}(e,D,z)},function(){if(!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,f,d,y,x=t._size,b=l.borderwidth,w=x.l+x.w*l.x-v[A(l)]*l._width,M=x.t+x.h*(1-l.y)-v[L(l)]*l._effHeight;if(t.margin.autoexpand){var T=w,C=M;w=a.constrain(w,0,t.width-l._width),M=a.constrain(M,0,t.height-l._effHeight),w!==T&&a.log("Constrain legend.x to make legend fit inside graph"),M!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(c.setTranslate(h,w,M),O.on(".drag",null),h.on("wheel",null),l._height<=l._maxHeight||e._context.staticPlot)k.attr({width:l._width-b,height:l._effHeight-b,x:b/2,y:b/2}),c.setTranslate(S,0,0),g.select("rect").attr({width:l._width-2*b,height:l._effHeight-2*b,x:b,y:b}),c.setClipUrl(S,r,e),c.setRect(O,0,0,0,0),delete l._scrollY;else{var P,D,z,R=Math.max(p.scrollBarMinHeight,l._effHeight*l._effHeight/l._height),E=l._effHeight-R-2*p.scrollBarMargin,I=l._height-l._effHeight,N=E/I,F=Math.min(l._scrollY||0,I);k.attr({width:l._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:l._effHeight-b,x:b/2,y:b/2}),g.select("rect").attr({width:l._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:l._effHeight-2*b,x:b,y:b+F}),c.setClipUrl(S,r,e),H(F,R,N),h.on("wheel",function(){H(F=a.constrain(l._scrollY+n.event.deltaY/E*I,0,I),R,N),0!==F&&F!==I&&n.event.preventDefault()});var j=n.behavior.drag().on("dragstart",function(){var e=n.event.sourceEvent;P="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,z=F}).on("drag",function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(D="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,H(F=function(e,t,r){var n=(r-t)/N+e;return a.constrain(n,0,I)}(z,P,D),R,N))});O.call(j);var B=n.behavior.drag().on("dragstart",function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(P=e.changedTouches[0].clientY,z=F)}).on("drag",function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(D=e.changedTouches[0].clientY,H(F=function(e,t,r){var n=(t-r)/N+e;return a.constrain(n,0,I)}(z,P,D),R,N))});S.call(B)}if(e._context.edits.legendPosition)h.classed("cursor-move",!0),s.init({element:h.node(),gd:e,prepFn:function(){var e=c.getTranslate(h);d=e.x,y=e.y},moveFn:function(e,t){var r=d+e,n=y+t;c.setTranslate(h,r,n),u=s.align(r,0,x.l,x.l+x.w,l.xanchor),f=s.align(n,0,x.t+x.h,x.t,l.yanchor)},doneFn:function(){void 0!==u&&void 0!==f&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":f})},clickFn:function(r,n){var a=t._infolayer.selectAll("g.traces").filter(function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom});a.size()>0&&_(e,h,a,r,n)}})}function H(t,r,n){l._scrollY=e._fullLayout.legend._scrollY=t,c.setTranslate(S,0,-t),c.setRect(O,l._width,p.scrollBarMargin+t*n,p.scrollBarWidth,r),g.select("rect").attr("y",b+t)}}],e)}}},{"../../constants/alignment":143,"../../lib":168,"../../lib/events":160,"../../lib/svg_text_utils":189,"../../plots/plots":252,"../../registry":261,"../color":49,"../dragelement":67,"../drawing":70,"./constants":98,"./get_legend_data":101,"./handle_click":102,"./helpers":103,"./style":105,d3:13}],101:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0;function d(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r0))return 0;a=t.width}return y?n:Math.min(a,r)};function b(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each(function(e){var t=n.select(this),r=e[0],a=x(r.mlw,o.line,v,h);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)})}function _(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=x(f(d.width,o.pts),d,v,h),g=i.minExtend(l,{marker:{line:{width:p}}});g.marker.line.color=d.color;var m=i.minExtend(o,{trace:g});u(c,m,g)}}e.each(function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)}).each(function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each(function(e,c){var u,f=n.select(this),d=s(a),p=d.colorscale,h=d.reversescale;if(p){if(!r){var g=p.length;u=0===c?p[h?g-1:0][1]:1===c?p[h?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[c]||v[0]:v}f.attr("d",e[0]),u?f.call(l.fill,u):f.call(function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,m(h,"radial"===r),p,"fill")}})})}).each(function(e){var t=e[0].trace,r=[];t.visible&&"waterfall"===t.type&&(r=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var a=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);a.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),a.exit().remove(),a.each(function(e){var r=n.select(this),a=t[e[0]].marker,i=x(void 0,a.line,v,h);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)})}).each(function(e){b(e,this,"funnel")}).each(function(e){b(e,this)}).each(function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each(function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=x(void 0,r.line,v,h);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?d:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}})}).each(function(e){_(e,this,"funnelarea")}).each(function(e){_(e,this,"pie")}).each(function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,d=c.hasLines(u),h=u.contours,v=!1,y=!1,b=s(u),_=b.colorscale,w=b.reversescale;if(h){var k=h.coloring;"lines"===k?v=!0:d="none"===k||"heatmap"===k||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==k&&"heatmap"!==k||(y=!0)}var M=c.hasMarkers(u)||c.hasText(u),T=f||y,A=d||v,L=M||!T?"M5,0":A?"M5,-2":"M5,-3",S=n.select(this),C=S.select(".legendfill").selectAll("path").data(f||y?[e]:[]);if(C.enter().append("path").classed("js-fill",!0),C.exit().remove(),C.attr("d",L+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,m(w),_,"fill")}}),d||v){var P=x(void 0,u.line,g,p);a=i.minExtend(u,{line:{width:P}}),r=[i.minExtend(l,{trace:a})]}var O=S.select(".legendlines").selectAll("path").data(d||v?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",L+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,m(w),_,"stroke")}})}).each(function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),g=c.hasLines(s);function v(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function m(e){return e[0]}if(u||f||g){var x={},b={};if(u){x.mc=v("marker.color",m),x.mx=v("marker.symbol",m),x.mo=v("marker.opacity",i.mean,[.2,1]),x.mlc=v("marker.line.color",m),x.mlw=v("marker.line.width",i.mean,[0,5],h),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=v("marker.size",i.mean,[2,16],d);x.ms=_,b.marker.size=_}g&&(b.line={width:v("line.width",m,[0,10],p)}),f&&(x.tx="Aa",x.tp=v("textposition",m),x.ts=10,x.tc=v("textfont.color",m),x.tf=v("textfont.family",m)),r=[i.minExtend(l,x)],(a=i.minExtend(s,b)).selectedpoints=null,a.texttemplate=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(u?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var M=w.selectAll("g.pointtext").data(f?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,t)}).each(function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=x(void 0,i.line,v,h);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)})}).each(function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=x(void 0,i.line,v,h);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)})})}},{"../../lib":168,"../../registry":261,"../../traces/pie/helpers":280,"../../traces/pie/style_one":281,"../../traces/scatter/subtypes":307,"../color":49,"../colorscale/helpers":60,"../drawing":70,d3:13}],106:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../lib"),l=e("../../fonts/ploticon"),s=o._,c=t.exports={};function u(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(T=["toggleHover"],A=["resetViews"]):d?(M=["zoomInGeo","zoomOutGeo"],T=["hoverClosestGeo"],A=["resetGeo"]):f?(T=["hoverClosest3d"],A=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(M=["zoomInMapbox","zoomOutMapbox"],T=["toggleHover"],A=["resetViewMapbox"]):g?T=["hoverClosestGl2d"]:p?T=["hoverClosestPie"]:x?(T=["hoverClosestCartesian","hoverCompareCartesian"],A=["resetViewSankey"]):T=["toggleHover"];u&&(T=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter(function(r){return t[r].anchor===e._id}),a=0,i=0;i0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o10?e/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:E?G(r.xanchor)+r.x0:G(r.x0),cy:I?V(r.yanchor)-r.y0:V(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:E?G(r.xanchor)+r.x1:G(r.x1),cy:I?V(r.yanchor)-r.y1:V(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():t,X={element:Y.node(),gd:e,prepFn:function(n){E&&(_=G(r.xanchor));I&&(w=V(r.yanchor));"path"===r.type?O=r.path:(m=E?r.x0:G(r.x0),y=I?r.y0:V(r.y0),x=E?r.x1:G(r.x1),b=I?r.y1:V(r.y1));mb?(k=y,L="y0",M=b,S="y1"):(k=b,L="y1",M=y,S="y0");W(n),$(p,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n);"paper"===a||s.autorange||(c+=a);l.setClipUrl(e,c?"clip"+r._fullLayout._uid+c:null,r)}(t,r,e),X.moveFn="move"===D?J:Q},doneFn:function(){u(t),K(p),h(t,e,r),n.call("_guiRelayout",e,j.getUpdateObj())},clickFn:function(){K(p)}};function W(e){if(N)D="path"===e.target.tagName?"move":"start-point"===e.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=e.clientX-r.left,o=e.clientY-r.top,l=!F&&n>z&&a>R&&!e.shiftKey?c.getCursor(i/n,1-o/a):"move";u(t,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,l=i;E?B("xanchor",r.xanchor=U(_+n)):(o=function(e){return U(G(e)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(e){return Z(V(e)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),B("path",r.path=v(O,o,l))}else E?B("xanchor",r.xanchor=U(_+n)):(B("x0",r.x0=U(m+n)),B("x1",r.x1=U(x+n))),I?B("yanchor",r.yanchor=Z(w+a)):(B("y0",r.y0=Z(y+a)),B("y1",r.y1=Z(b+a)));t.attr("d",g(e,r)),$(p,r)}function Q(n,a){if(F){var i=function(e){return e},o=i,l=i;E?B("xanchor",r.xanchor=U(_+n)):(o=function(e){return U(G(e)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(e){return Z(V(e)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),B("path",r.path=v(O,o,l))}else if(N){if("resize-over-start-point"===D){var s=m+n,c=I?y-a:y+a;B("x0",r.x0=E?s:U(s)),B("y0",r.y0=I?c:Z(c))}else if("resize-over-end-point"===D){var u=x+n,f=I?b-a:b+a;B("x1",r.x1=E?u:U(u)),B("y1",r.y1=I?f:Z(f))}}else{var h=~D.indexOf("n")?k+a:k,j=~D.indexOf("s")?M+a:M,Y=~D.indexOf("w")?T+n:T,X=~D.indexOf("e")?A+n:A;~D.indexOf("n")&&I&&(h=k-a),~D.indexOf("s")&&I&&(j=M-a),(!I&&j-h>R||I&&h-j>R)&&(B(L,r[L]=I?h:Z(h)),B(S,r[S]=I?j:Z(j))),X-Y>z&&(B(C,r[C]=E?Y:U(Y)),B(P,r[P]=E?X:U(X)))}t.attr("d",g(e,r)),$(p,r)}function $(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=G(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:d.extractPathCoords(t.path,f.paramIsX))),o=V(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:d.extractPathCoords(t.path,f.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.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(e){e.selectAll(".visual-cue").remove()}c.init(X),Y.node().onmousemove=W}(e,x,r,t,p)}}function h(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");l.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function g(e,t){var r,n,o,l,s,c,u,p,h=t.type,g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(g?(r=d.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=d.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===h)return g&&"date"===g.type&&(n=d.decodeDate(n)),v&&"date"===v.type&&(l=d.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(f.segmentRE,function(e){var n=0,c=e.charAt(0),u=f.paramIsX[c],d=f.paramIsY[c],p=f.numParams[c],h=e.substr(1).replace(f.paramRE,function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>p&&(e="X"),e});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+h})}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,p=x-t.y1}else u=l(t.y0),p=l(t.y1);if("line"===h)return"M"+s+","+u+"L"+c+","+p;if("rect"===h)return"M"+s+","+u+"H"+c+"V"+p+"H"+s+"Z";var b=(s+c)/2,_=(u+p)/2,w=Math.abs(b-s),k=Math.abs(_-u),M="A"+w+","+k,T=b+w+","+_;return"M"+T+M+" 0 1,1 "+(b+","+(_-k))+M+" 0 0,1 "+T+"Z"}function v(e,t,r){return e.replace(f.segmentRE,function(e){var n=0,a=e.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],l=f.numParams[a];return a+e.substr(1).replace(f.paramRE,function(e){return n>=l?e:(i[n]?e=t(e):o[n]&&(e=r(e)),n++,e)})})}t.exports={draw:function(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,function(n){n.call(M,t,e,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each(function(){n.select(this).selectAll("g."+u.groupClassName).each(l)}).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return R.call(E),D&&(L?R.on(".opacity",null):(M=0,T=!0,R.text(m).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),R.call(u.makeEditable,{gd:e}).on("edit",function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(E)}).on("input",function(e){this.text(e||" ").call(u.positionText,b.x,b.y)})),R.classed("js-placeholder",T),w}}},{"../../constants/alignment":143,"../../constants/interactions":145,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":252,"../../registry":261,"../color":49,"../drawing":70,d3:13,"fast-isnumeric":15}],137:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":161,"../../plot_api/edit_types":196,"../../plot_api/plot_template":203,"../../plots/font_attributes":239,"../../plots/pad_attributes":251,"../color/attributes":48}],138:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],139:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":209,"./attributes":137,"./constants":138}],140:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,function(e){e.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(k,o),u.call(_,o)})}),u.call(_,o),x?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)}).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(e){e.style("pointer-events","all")}),u=0;uw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:T,height:A}),this._hbarXMin=L+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>k,O=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,R=v;z+O>s&&(z=s-O);var E=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=E.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:R,width:O,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,N=u-.5,F=P?f+O+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(M||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),M||P?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||P){var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var G=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(G),P&&this.vbar.on(".drag",null).call(G)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":49,"../drawing":70,d3:13}],143:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],144:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],145:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],146:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],147:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],148:[function(e,t,r){"use strict";r.version="1.52.2",e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],151:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],152:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":175}],153:[function(e,t,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every(function(e){return a(e).isValid()})?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var M=k[1],T=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===M.length)return u;var P;M=Number(M);try{var O=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),P=O.newDate(M,O.toMonthIndex(M,T,D),A)}else P=O.newDate(M,Number(T),A)}catch(e){return u}return P?(P.toJD()-g)*f+L*d+S*p+C*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),T-=1;var z=new Date(Date.UTC(2e3,T,A,L,S));return z.setUTCFullYear(M),z.getUTCMonth()!==T?u:z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,M=3*d,T=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var P=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++},50)})}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":175}],167:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],168:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function M(e){var t={};for(var r in e)for(var n=e[r],a=0;ao?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n){for(var a=e.length,i=new Array(a),o=0;o=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0})},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""})};var P={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(P,arguments)};var O={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(O,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,function(e,l,c){var u,f,d,p;for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;s.seedPseudoRandom=function(){R=2e9},s.pseudoRandom=function(){var e=R;return R=(69069*R+1)%4294967296,Math.abs(R-e)<429496729?s.pseudoRandom():R/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":146,"./anchor_utils":151,"./angles":152,"./array":153,"./clean_number":154,"./clear_responsive":156,"./coerce":157,"./dates":158,"./dom":159,"./extend":161,"./filter_unique":162,"./filter_visible":163,"./geometry2d":166,"./identity":167,"./is_plain_object":169,"./keyed_container":170,"./localize":171,"./loggers":172,"./make_trace_groups":173,"./matrix":174,"./mod":175,"./nested_property":176,"./noop":177,"./notifier":178,"./push_unique":181,"./regex":183,"./relative_attr":184,"./relink_private":185,"./search":186,"./stats":188,"./throttle":190,"./to_log_range":191,d3:13,"fast-isnumeric":15}],169:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],170:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":201,"./notifier":178}],173:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,function(e){return e[0].trace.uid});a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each(function(e){e[0][i]=n.select(this)}),a}},{d3:13}],174:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],176:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl||t&&s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":146,"./matrix":174}],181:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function c(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,u,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t=e.slice();t.sort(r.sorterAsc);for(var n=t.length-1,a=t[n]-t[0]||1,i=a/(n||1)/1e4,o=[t[0]],l=0;lt[l]+i&&(a=Math.min(a,t[l+1]-t[l]),o.push(t[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":153,"fast-isnumeric":15}],189:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,A){var L=e.text(),C=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(s),P=n.select(e.node().parentNode);if(!P.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",P.selectAll("svg."+O).remove(),P.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(t&&t._promises||[]).push(new Promise(function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue(function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())},function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)},function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})}(C[2],i,function(n,a,i){P.selectAll("svg."+O).remove(),P.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return D(),void t();var s=P.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===O[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),A&&A.call(e,s),t(s)})})):D(),e}function D(){P.empty()||(O=e.attr("class")+"-math",P.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var P=t.split(m),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h="\u200b",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,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(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(e){return e.replace(L,function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e})}function C(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(e){return e.selectAll("tspan.line").size()||1},r.positionText=function(e,t,r){return e.each(function(){var e=n.select(this);function a(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var i=a("x",t),o=a("y",r);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:i,y:o})})},r.makeEditable=function(e,t){var r=t.gd,a=t.delegate,i=n.dispatch("edit","input","cancel"),o=a||e;if(e.style({"pointer-events":a?"none":"all"}),1!==e.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=e.node().style,c=parseFloat(l.fontSize||12),u=t.text;void 0===u&&(u=e.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:t.fill||l.fill||"black",opacity:1,"background-color":t.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(e,a,t)).on("blur",function(){r._editing=!1,e.text(this.textContent).style({opacity:1});var t,a=n.select(this).attr("class");(t=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(t).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(e,o)}).on("focus",function(){var e=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,e.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),i.cancel.call(e,this.textContent)):(i.input.call(e,this.textContent),n.select(this).call(C(e,a,t)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),e.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(a).style({opacity:0})}function s(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return t.immediate?l():o.on("click",l),n.rebind(e,i,"on")}},{"../constants/alignment":143,"../constants/xmlns_namespaces":147,"../lib":168,d3:13}],190:[function(e,t,r){"use strict";var n={};function a(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}r.throttle=function(e,t,r){var i=n[e],o=Date.now();if(!i){for(var l in n)n[l].tsi.ts+t?s():i.timer=setTimeout(function(){s(),i.timer=null},t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise(function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}}):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],191:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":15}],192:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":241,"topojson-client":32}],193:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],194:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],195:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,M,T,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],P=u(m,f).get(),O=[],D=-1,z=C.length;for(x=0;xC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?O.push(_):T?("add"===M&&(M={}),C.splice(_,0,M),P&&P.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(O[x],1),P&&P.splice(O[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var R;if(-1===D)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x=D);x++)R.push(_);for(x=D;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),R(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&R(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in R(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=z(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function V(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=J(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(M.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(M.doLegend),i.layoutstyle&&l.push(M.layoutStyles),i.axrange&&Z(l,a.rangesAltered),i.ticks&&l.push(M.doTicksRelayout),i.modebar&&l.push(M.doModeBar),i.camera&&l.push(M.doCamera),i.colorbars&&l.push(M.doColorBars),l.push(C)),l.push(d.rehover,d.redrag),c.add(e,V,[e,a.undoit],V,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",a.eventData),e})}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Z(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,M.doAutoRangeAndConstraints,r,M.drawData,M.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function J(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(G(t),p=Object.keys(t),n=0;n0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],N=z.parts[E-1]+"."+I,F=z.parts.slice(0,E).join("."),H=l(e.layout,F).get(),q=l(s,F).get(),V=z.get();if(void 0!==R){M[D]=R,L[D]="reverse"===I?R:j(V);var U=f.getLayoutValObject(s,z.parts);if(U&&U.impliedEdits&&null!==R)for(var Z in U.impliedEdits)S(o.relativeAttr(D,Z),U.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(R){S("autosize",null);var J="height"===D?"width":"height";S(J,s[J])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",R?null:s.width),S("height",R?null:s.height);else if(N.match(Y))O(N),l(s,F+"._inputRange").set(null);else if(N.match(X)){O(N),l(s,F+"._inputRange").set(null);var $=l(s,F).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else N.match(W)&&l(s,F+"._inputDomain").set(null);if("type"===I){var K=H,ee="linear"===q.type&&"log"===R,te="log"===q.type&&"linear"===R;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(F+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(F+".range[0]",Math.log(re)/Math.LN10),S(F+".range[1]",Math.log(ne)/Math.LN10)):(S(F+".range[0]",Math.pow(10,re)),S(F+".range[1]",Math.pow(10,ne)))}else S(F+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,R,S),u.getComponentMethod("images","convertCoords")(e,q,R,S)}else S(F+".autorange",!0),S(F+".range",null);l(s,F+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(R||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=U||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(R)?L[D]=null:w.isRemoveVal(R)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=R,delete t[D]}else"reverse"===I?(H.range?H.range.reverse():(S(F+".autorange",!0),H.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===R||"select"===R)&&"lasso"!==V&&"select"!==V?_.plot=!0:s._has("gl2d")?_.plot=!0:U?T.update(_,U):_.calc=!0,z.set(R))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in P)for(n=0;n1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ae(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then(function(){t.onComplete&&t.onComplete()}),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=null==t,b=Array.isArray(t);if(x||b||!o.isPlainObject(t)){if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&T.push(g);y=T}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&Lt.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!k(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function k(e){return e===Math.round(e)&&e>=0}function M(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return w(a,t,l)},r.getLayoutValObject=function(e,t){return w(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;l&&(o=a);var s,c=t+"["+o+"]";function u(){s={},l&&(s[c]={},s[c][i]=l)}function f(e,t){l?n.nestedProperty(s[c],e).set(t):s[c+"."+e]=t}function d(){var e=s;return u(),e}return u(),{modifyBase:function(e,t){s[e]=t},modifyItem:f,getUpdateObj:d,applyUpdate:function(t,r){t&&f(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":210}],204:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";function _(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function w(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,y=m.p,x=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function b(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-y-n:t._offset+t._length+y+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+y+n:t._offset-y-n:m.l+m.w*(e.position||0)+n%1}for(t=0;tk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=p(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&h(i)&&e(i,o)}}({data:v,layout:d},""),u.length)return u.map(g)}},{"../lib":168,"../plots/attributes":210,"../plots/plots":252,"./plot_config":201,"./plot_schema":202,"./plot_template":203}],206:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../lib"),o=e("../snapshot/helpers"),l=e("../snapshot/tosvg"),s=e("../snapshot/svgtoimg"),c={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,u,f,d;function p(e){return!(e in t)||i.validate(t[e],c[e])}if(t=t||{},i.isPlainObject(e)?(r=e.data||[],u=e.layout||{},f=e.config||{},d={}):(e=i.getGraphDiv(e),r=i.extendDeep([],e.data),u=i.extendDeep({},e.layout),f=e._context,d=e._fullLayout||{}),!p("width")&&null!==t.width||!p("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!p("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var h={};function g(e,r){return i.coerce(t,h,c,e,r)}var v=g("format"),m=g("width"),y=g("height"),x=g("scale"),b=g("setBackground"),_=g("imageDataOnly"),w=document.createElement("div");w.style.position="absolute",w.style.left="-5000px",document.body.appendChild(w);var k=i.extendFlat({},u);m?k.width=m:null===t.width&&n(d.width)&&(k.width=d.width),y?k.height=y:null===t.height&&n(d.height)&&(k.height=d.height);var M=i.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:b}),T=o.getRedrawFunc(w);function A(){return new Promise(function(e){setTimeout(e,o.getDelay(w._fullLayout))})}function L(){return new Promise(function(e,t){var r=l(w,v,x),n=w._fullLayout.width,c=w._fullLayout.height;if(a.purge(w),document.body.removeChild(w),"svg"===v)return e(_?r:o.encodeSVG(r));var u=document.createElement("canvas");u.id=i.randstr(),s({format:v,width:n,height:c,scale:x,canvas:u,svg:r,promise:!0}).then(e).catch(t)})}return new Promise(function(e,t){a.plot(w,r,k,M).then(T).then(A).then(L).then(function(t){e(function(e){return _?e.replace(o.IMAGE_URL_PREFIX,""):e}(t))}).catch(function(e){t(e)})})}},{"../lib":168,"../snapshot/helpers":265,"../snapshot/svgtoimg":267,"../snapshot/tosvg":269,"./plot_api":200,"fast-isnumeric":15}],207:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(p("unused",i,m.concat(x.length)));var T,A,L,S,C,P=x.length,O=Array.isArray(M);if(O&&(P=Math.min(P,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(p("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(T=0;T<(O?Math.min(D,M[A].length):D);T++)L=O?M[A][T]:M,S=y[A][T],C=x[A][T],n.validate(S,L)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(A,T),S,C)):a.push(p("value",i,m.concat(A,T),S))}else a.push(p("array",i,m.concat(A),y[A]));else for(A=0;A1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,m=0;m0&&((b=T-o(v)-o(m))>A?_/b>L&&(y=v,x=m,L=_/b):_/T>L&&(y={val:v.val,pad:0},x={val:m.val,pad:0},L=_/T));if(d===p){var S=d-1,C=d+1;if(k)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce(function(e,t){return Math.max(e,o(t))},0),O=d/(1-Math.min(.5,P/T));i=d>0?[0,O]:[O,0]}else i=M?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):M&&(y.val-L*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),L=(x.val-y.val)/(T-o(y)-o(x)),i=[y.val-L*o(y),x.val+L*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,M=r.vpadLinearized||!1;function T(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=T((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=D;a--)O(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":146,"../../lib":168,"../../registry":261,"fast-isnumeric":15}],213:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),M=k.MID_SHIFT,T=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),P=e("./axis_ids");S.id2name=P.id2name,S.name2id=P.name2id,S.cleanId=P.cleanId,S.list=P.list,S.listIds=P.listIds,S.getFromId=P.getFromId,S.getFromTrace=P.getFromTrace;var O=e("./autorange");S.getAutoRange=O.getAutoRange,S.findExtremes=O.findExtremes,S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i),0;return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e){var t=l.simpleMap(e.range,e.r2l);if("auto"===e.tickmode||!e.dtick){var r,n=e.nticks;n||("category"===e.type||"multicategory"===e.type?(r=e.tickfont?1.2*(e.tickfont.size||12):15,n=e._length/r):(r="y"===e._id.charAt(0)?40:80,n=l.constrain(e._length/r,4,9)+1),"radialaxis"===e._name&&(n*=2)),"array"===e.tickmode&&(n*=100),S.autoTicks(e,Math.abs(t[1]-t[0])/n),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),G(e)},S.calcTicks=function(e){S.prepTicks(e);var t=l.simpleMap(e.range,e.r2l);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=l.simpleMap(e.range,e.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],s=Math.min(i,o),c=Math.max(i,o),u=0;Array.isArray(r)||(r=[]);var f="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var d=0;ds&&p=n:f<=n)&&!(o.length>u||f===c);f=S.tickIncrement(f,e.dtick,i,e.calendar)){c=f;var d=!1;s&&f!==(0|f)&&(d=!0),o.push({minor:d,value:f})}oe(e)&&360===Math.abs(t[1]-t[0])&&o.pop(),e._tmax=(o[o.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var p=new Array(o.length),h=0;h10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Z(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function V(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,E)):i>v?(t/=v,e.dtick="M"+q(t,1,I)):i>m?(e.dtick=q(t,m,F),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,I):i>x?e.dtick=q(t,x,N):i>b?e.dtick=q(t,b,N):(r=n(10),e.dtick=q(t,r,E))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,E)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):oe(e)?(e.tick0=0,r=1,e.dtick=q(t,r,H)):(e.tick0=0,r=n(10),e.dtick=q(t,r,E));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?B:j,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e){var t=e.r2l||Number,r=l.simpleMap(e.range,t),i=r[1]"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=X(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Z(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=X(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):oe(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=X(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){var r=1;for(;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=X(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=X(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var U=["f","p","n","\u03bc","m","","k","M","G","T"];function Z(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function X(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};G(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":Z(s)&&(e+=U[c/3+5]));return i?_+e:e}function W(e,t){for(var r=[],n={},a=0;a1&&r=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=Q(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}X&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,ee(t),n),i.autoMargin(e,te(t),a),i.autoMargin(e,re(t),l)}),r.skipTitle||X&&"bottom"===t.side||Z.push(function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+Q(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)}),l.syncOrAsync(Z)}}function $(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each(function(){var e=K(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)})):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map(function(e){return-e})),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*M},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],J);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l1)for(n=1;n2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;tn?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;ns*x)||k)for(r=0;rz&&IO&&(O=I);p/=(O-P)/(2*D),P=c.l2r(P),O=c.l2r(O),c.range=c._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function R(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function E(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function I(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),N(e,t,a,i)}function N(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function F(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function j(e){L&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),L=!1)}function B(e){return"lasso"===e||"select"===e}function H(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,A)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function q(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d-1&&w(a,e,X,W,t.id,Le),i.indexOf("event")>-1&&f.click(e,a,t.id);else if(1===r&&pe){var l=L?U:N,c="s"===L||"w"===S?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,c),p="left",h="middle";if(l.fixedrange)return;L?(h="n"===L?"top":"bottom","right"===l.side&&(p="right")):"e"===S&&(p="right"),e._context.showAxisRangeEntryBoxes&&n.select(ve).call(s.makeEditable,{gd:e,immediate:!0,background:e._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",function(t){var r=l.d2r(t);void 0!==r&&o.call("_guiRelayout",e,u,r)})}}function Pe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,t+me)),a=Math.max(0,Math.min(K,r+ye)),i=Math.abs(n-me),o=Math.abs(a-ye);function l(){ke="",xe.r=xe.l,xe.t=xe.b,Te.attr("d","M0,0Z")}if(xe.l=Math.min(me,n),xe.r=Math.max(me,n),xe.t=Math.min(ye,a),xe.b=Math.max(ye,a),ee.isSubplotConstrained)i>A||o>A?(ke="xy",i/$>o/K?(o=i*K/$,ye>a?xe.t=ye-o:xe.b=ye+o):(i=o*$/K,me>n?xe.l=me-i:xe.r=me+i),Te.attr("d",H(xe))):l();else if(te.isSubplotConstrained)if(i>A||o>A){ke="xy";var s=Math.min(xe.l/$,(K-xe.b)/K),c=Math.max(xe.r/$,(K-xe.t)/K);xe.l=s*$,xe.r=c*$,xe.b=(1-s)*K,xe.t=(1-c)*K,Te.attr("d",H(xe))}else l();else!ne||og[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":168,"fast-isnumeric":15}],229:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":143}],230:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/color"),o=e("../../components/fx"),l=e("../../lib"),s=e("../../lib/polygon"),c=e("../../lib/throttle"),u=e("../../components/fx/helpers").makeEventData,f=e("./axis_ids").getFromId,d=e("../../lib/clear_gl_canvases"),p=e("../../plot_api/subroutines").redrawReglTraces,h=e("./constants"),g=h.MINSELECT,v=s.filter,m=s.tester;function y(e){return e._id}function x(e,t,r,n,a,i,o){var l,s,c,u,f,d,p,h,g,v=t._hoverdata,m=t._fullLayout.clickmode.indexOf("event")>-1,y=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){k(e,t,i);var x=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=L(x))){for(o&&o.remove(),g=0;g0?"M"+a.join("M")+"Z":"M0,0Z",t.attr("d",n)}function L(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,a=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function S(e,t,r){var n,i,o,l;for(n=0;n-1&&x(t,L,a.xaxes,a.yaxes,a.subplot,a,U),"event"===r&&L.emit("plotly_selected",void 0);o.click(L,t)}).catch(l.error)},a.doneFn=function(){Y.remove(),c.done(X).then(function(){c.clear(X),a.gd.emit("plotly_selected",_),p&&a.selectionDefs&&(p.subtract=V,a.selectionDefs.push(p),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,d)),a.doneFnCompleted&&a.doneFnCompleted(W)}).catch(l.error)}},clearSelect:P,selectOnClick:x}},{"../../components/color":49,"../../components/fx":87,"../../components/fx/helpers":84,"../../lib":168,"../../lib/clear_gl_canvases":155,"../../lib/polygon":180,"../../lib/throttle":190,"../../plot_api/subroutines":204,"../../registry":261,"./axis_ids":216,"./constants":219,polybooljs:22}],231:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=e("./constants"),v=e("./axis_ids");function m(e){return Math.pow(10,e)}function y(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function x(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function b(t,r,n){var o=s(t,n||e.calendar);if(o===p){if(!a(t))return p;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-l/10);o=s(new Date(c))+l/10}return o}function _(t,r,n){return l(t,r,n||e.calendar)}function w(t){return e._categories[Math.round(t)]}function k(t){if(y(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function M(t){if(e._categoriesMap)return e._categoriesMap[t]}function T(e){var t=M(e);return void 0!==t?t:a(e)?+e:void 0}function A(t){return a(t)?n.round(e._b+e._m*t,2):p}function L(t){return(t-e._b)/e._m}e.c2l="log"===e.type?x:c,e.l2c="log"===e.type?m:c,e.l2p=A,e.p2l=L,e.c2p="log"===e.type?function(e,t){return A(x(e,t))}:A,e.p2c="log"===e.type?function(e){return m(L(e))}:L,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=L,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return x(o(e),t)},e.r2d=e.r2c=function(e){return m(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=x,e.l2d=m,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return m(L(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=L,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=b,e.c2d=e.c2r=e.l2d=e.l2r=_,e.d2p=e.r2p=function(t,r,n){return e.l2p(b(t,0,n))},e.p2d=e.p2r=function(e,t,r){return _(L(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=k,e.r2d=e.c2d=e.l2d=w,e.d2r=e.d2l_noadd=T,e.r2c=function(t){var r=T(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=T,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return w(L(e))},e.r2p=e.d2p,e.p2r=L,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=w,e.d2r=e.d2l_noadd=T,e.r2c=function(t){var r=T(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=M,e.l2r=e.c2r=c,e.r2l=T,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return w(L(e))},e.r2p=e.d2p,e.p2r=L,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;ad&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=v.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l=e.r2l(e[i][0],o),s=e.r2l(e[i][1],o);if("y"===f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(l-s),e._b=-e._m*s):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(s-l),e._b=-e._m*l),!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.makeCalcdata=function(t,r){var n,a,o,l,s=e.type,c="date"===s&&t[r+"calendar"];if(r in t){if(n=t[r],l=t._length||i.minRowLength(n),i.isTypedArray(n)&&("linear"===s||"log"===s)){if(l===n.length)return n;if(n.subarray)return n.subarray(0,l)}if("multicategory"===s)return function(e,t){for(var r=new Array(t),n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,M=f?p[0]:0,T=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,M,T).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":70,"../../lib":168,"../../registry":261,"./axes":213,d3:13}],236:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}})}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new b(e)},_.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var l in v.layerNameToAdjective)if("frame"!==l&&a["show"+l]){o=!0;break}for(var s=0;s0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),c.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this.render()}},_.updateProjection=function(e,t){var r=this.graphDiv,o=t[this.id],l=t._size,s=o.domain,c=o.projection,u=o.lonaxis,d=o.lataxis,p=u._ax,h=d._ax,g=this.projection=function(e){for(var t=e.projection.type,r=n.geo[v.projNames[t]](),a=e._isClipped?v.lonaxisSpan[t]/2:null,i=["center","rotate","parallels","clipExtent"],o=function(e){return e?r:[]},l=0;la*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(e){return r.getPath().bounds(e)},r.fitExtent=function(e,t){var n=e[1][0]-e[0][0],a=e[1][1]-e[0][1],i=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),i&&r.clipExtent(null);var o=r.getBounds(t),l=Math.min(n/(o[1][0]-o[0][0]),a/(o[1][1]-o[0][1])),s=+e[0][0]+(n-l*(o[1][0]+o[0][0]))/2,c=+e[0][1]+(a-l*(o[1][1]+o[0][1]))/2;return i&&r.clipExtent(i),r.scale(150*l).translate([s,c])},r.precision(v.precision),a&&r.clipAngle(a-v.clipPad);return r}(o),m=[[l.l+l.w*s.x[0],l.t+l.h*(1-s.y[1])],[l.l+l.w*s.x[1],l.t+l.h*(1-s.y[0])]],y=o.center||{},x=c.rotation||{},b=u.range||[],_=d.range||[];if(o.fitbounds){p._length=m[1][0]-m[0][0],h._length=m[1][1]-m[0][1],p.range=f(r,p),h.range=f(r,h);var k=(p.range[0]+p.range[1])/2,M=(h.range[0]+h.range[1])/2;if(o._isScoped)y={lon:k,lat:M};else if(o._isClipped){y={lon:k,lat:M},x={lon:k,lat:M,roll:x.roll};var T=c.type,A=v.lonaxisSpan[T]/2||180,L=v.lataxisSpan[T]/2||180;b=[k-A,k+A],_=[M-L,M+L]}else y={lon:k,lat:M},x={lon:k,lat:x.lat,roll:x.roll}}g.center([y.lon-x.lon,y.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(c.parallels);var S=w(b,_);g.fitExtent(m,S);var C=this.bounds=g.getBounds(S),P=this.fitScale=g.scale(),O=g.translate();if(!isFinite(C[0][0])||!isFinite(C[0][1])||!isFinite(C[1][0])||!isFinite(C[1][1])||isNaN(O[0])||isNaN(O[0])){for(var D=["fitbounds","projection.rotation","center","lonaxis.range","lataxis.range"],z="Invalid geo settings, relayout'ing to default view.",R={},E=0;E-1&&h(n.event,i,[r.xaxis],[r.yaxis],r.id,f),c.indexOf("event")>-1&&s.click(i,n.event))})}function v(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},_.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(l.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(e.mockAxis,r)},_.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},i.extendFlat(this.viewInitial,t)},_.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",function(e){return r(e.geojson)});for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":49,"../../components/dragelement":67,"../../components/drawing":70,"../../components/fx":87,"../../lib":168,"../../lib/geo_location_utils":164,"../../lib/topojson_utils":192,"../../registry":261,"../cartesian/autorange":212,"../cartesian/axes":213,"../cartesian/select":230,"../plots":252,"./constants":241,"./projections":246,"./zoom":247,d3:13,"topojson-client":32}],243:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s[o]={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots[o],l=0;l0&&P<0&&(P+=360);var O,D,z,R=(C+P)/2;if(!p){var E=h?f.projRotate:[R,0,0];O=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!h&&y)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!y&&void 0)&&r("oceancolor")}(p?(D=-96.6,z=38.7):(D=h?R:O,z=(S[0]+S[1])/2),r("center.lon",D),r("center.lat",z),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!y&&void 0)&&r("landcolor"),r("showlakes",!!y&&void 0)&&r("lakecolor"),r("showrivers",!!y&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&y)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",y),r("subunitcolor"),r("subunitwidth")),h||r("showframe",y)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):v?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":168,"../get_data":248,"../subplot_defaults":259,"./constants":241,"./layout_attributes":244}],246:[function(e,t,r){"use strict";t.exports=function(e){function t(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:r(e.geometry,t)}}function r(t,n){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(e){return r(e,n)})};if(!c.hasOwnProperty(t.type))return null;var a=c[t.type];return e.geo.stream(t,n(a)),a.result()}e.geo.project=function(e,t){var a=t.stream;if(!a)throw new Error("not yet supported");return(e&&n.hasOwnProperty(e.type)?n[e.type]:r)(e,a)};var n={Feature:t,FeatureCollection:function(e,r){return{type:"FeatureCollection",features:e.features.map(function(e){return t(e,r)})}}},a=[],i=[],o={point:function(e,t){a.push([e,t])},result:function(){var e=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],e}},l={lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){a.length&&(i.push(a),a=[])},result:function(){var e=i.length?i.length<2?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}:null;return i=[],e}},s={polygonStart:u,lineStart:u,point:function(e,t){a.push([e,t])},lineEnd:function(){var e=a.length;if(e){do{a.push(a[0].slice())}while(++e<4);i.push(a),a=[]}},polygonEnd:u,result:function(){if(!i.length)return null;var e=[],t=[];return i.forEach(function(r){!function(e){if((t=e.length)<4)return!1;for(var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];++rn^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0})||e.push([t])}),i=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}},c={Point:o,MultiPoint:o,LineString:l,MultiLineString:l,Polygon:s,MultiPolygon:s,Sphere:s};function u(){}var f=1e-6,d=f*f,p=Math.PI,h=p/2,g=(Math.sqrt(p),p/180),v=180/p;function m(e){return e>1?h:e<-1?-h:Math.asin(e)}function y(e){return e>1?0:e<-1?p:Math.acos(e)}var x=e.geo.projection,b=e.geo.projectionMutator;function _(e,t){var r=(2+h)*Math.sin(t);t/=2;for(var n=0,a=1/0;n<10&&Math.abs(a)>f;n++){var i=Math.cos(t);t-=a=(t+Math.sin(t)*(i+2)-r)/(2*i*(1+i))}return[2/Math.sqrt(p*(4+p))*e*(1+Math.cos(t)),2*Math.sqrt(p/(4+p))*Math.sin(t)]}e.geo.interrupt=function(t){var r,n=[[[[-p,0],[0,h],[p,0]]],[[[-p,0],[0,-h],[p,0]]]];function a(e,r){for(var a=r<0?-1:1,i=n[+(r<0)],o=0,l=i.length-1;oi[o][2][0];++o);var s=t(e-i[o][1][0],r);return s[0]+=t(i[o][1][0],a*r>a*i[o][0][1]?i[o][0][1]:r)[0],s}t.invert&&(a.invert=function(e,i){for(var o=r[+(i<0)],l=n[+(i<0)],c=0,u=o.length;c=0;--a){var o=n[1][a],s=180*o[0][0]/p,c=180*o[0][1]/p,u=180*o[1][1]/p,f=180*o[2][0]/p,d=180*o[2][1]/p;r.push(l([[f-t,d-t],[f-t,u+t],[s+t,u+t],[s+t,c-t]],30))}return{type:"Polygon",coordinates:[e.merge(r)]}}(),s)},a},i.lobes=function(e){return arguments.length?(n=e.map(function(e){return e.map(function(e){return[[e[0][0]*p/180,e[0][1]*p/180],[e[1][0]*p/180,e[1][1]*p/180],[e[2][0]*p/180,e[2][1]*p/180]]})}),r=n.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],a=t(e[2][0],e[2][1])[0],i=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return i>o&&(r=i,i=o,o=r),[[n,i],[a,o]]})}),i):n.map(function(e){return e.map(function(e){return[[180*e[0][0]/p,180*e[0][1]/p],[180*e[1][0]/p,180*e[1][1]/p],[180*e[2][0]/p,180*e[2][1]/p]]})})},i},_.invert=function(e,t){var r=.5*t*Math.sqrt((4+p)/p),n=m(r),a=Math.cos(n);return[e/(2/Math.sqrt(p*(4+p))*(1+a)),m((n+r*(a+2))/(2+h))]},(e.geo.eckert4=function(){return x(_)}).raw=_;var w=e.geo.azimuthalEqualArea.raw;function k(e,t){if(arguments.length<2&&(t=e),1===t)return w;if(t===1/0)return M;function r(r,n){var a=w(r/t,n);return a[0]*=e,a}return r.invert=function(r,n){var a=w.invert(r/e,n);return a[0]*=t,a},r}function M(e,t){return[e*Math.cos(t)/Math.cos(t/=2),2*Math.sin(t)]}function T(e,t){return[3*e/(2*p)*Math.sqrt(p*p/3-t*t),t]}function A(e,t){return[e,1.25*Math.log(Math.tan(p/4+.4*t))]}function L(e){return function(t){var r,n=e*Math.sin(t),a=30;do{t-=r=(t+Math.sin(t)-n)/(1+Math.cos(t))}while(Math.abs(r)>f&&--a>0);return t/2}}M.invert=function(e,t){var r=2*m(t/2);return[e*Math.cos(r/2)/Math.cos(r),r]},(e.geo.hammer=function(){var e=2,t=b(k),r=t(e);return r.coefficient=function(r){return arguments.length?t(e=+r):e},r}).raw=k,T.invert=function(e,t){return[2/3*p*e/Math.sqrt(p*p/3-t*t),t]},(e.geo.kavrayskiy7=function(){return x(T)}).raw=T,A.invert=function(e,t){return[e,2.5*Math.atan(Math.exp(.8*t))-.625*p]},(e.geo.miller=function(){return x(A)}).raw=A,L(p);var S=function(e,t,r){var n=L(r);function a(r,a){return[e*r*Math.cos(a=n(a)),t*Math.sin(a)]}return a.invert=function(n,a){var i=m(a/t);return[n/(e*Math.cos(i)),m((2*i+Math.sin(2*i))/r)]},a}(Math.SQRT2/h,Math.SQRT2,p);function C(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(e.geo.mollweide=function(){return x(S)}).raw=S,C.invert=function(e,t){var r,n=t,a=25;do{var i=n*n,o=i*i;n-=r=(n*(1.007226+i*(.015085+o*(.028874*i-.044475-.005916*o)))-t)/(1.007226+i*(.045255+o*(.259866*i-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},(e.geo.naturalEarth=function(){return x(C)}).raw=C;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function O(e,t){var r,n=Math.min(18,36*Math.abs(t)/p),a=Math.floor(n),i=n-a,o=(r=P[a])[0],l=r[1],s=(r=P[++a])[0],c=r[1],u=(r=P[Math.min(19,++a)])[0],f=r[1];return[e*(s+i*(u-o)/2+i*i*(u-2*s+o)/2),(t>0?h:-h)*(c+i*(f-l)/2+i*i*(f-2*c+l)/2)]}function D(e,t){return[e*Math.cos(t),t]}function z(e,t){var r,n=Math.cos(t),a=(r=y(n*Math.cos(e/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(e)*a,Math.sin(t)*a]}function R(e,t){var r=z(e,t);return[(r[0]+e/h)/2,(r[1]+t)/2]}P.forEach(function(e){e[1]*=1.0144}),O.invert=function(e,t){var r=t/h,n=90*r,a=Math.min(18,Math.abs(n/5)),i=Math.max(0,Math.floor(a));do{var o=P[i][1],l=P[i+1][1],s=P[Math.min(19,i+2)][1],c=s-o,u=s-2*l+o,f=2*(Math.abs(r)-l)/c,p=u/c,m=f*(1-p*f*(1-2*p*f));if(m>=0||1===i){n=(t>=0?5:-5)*(m+a);var y,x=50;do{m=(a=Math.min(18,Math.abs(n)/5))-(i=Math.floor(a)),o=P[i][1],l=P[i+1][1],s=P[Math.min(19,i+2)][1],n-=(y=(t>=0?h:-h)*(l+m*(s-o)/2+m*m*(s-2*l+o)/2)-t)*v}while(Math.abs(y)>d&&--x>0);break}}while(--i>=0);var b=P[i][0],_=P[i+1][0],w=P[Math.min(19,i+2)][0];return[e/(_+m*(w-b)/2+m*m*(w-2*_+b)/2),n*g]},(e.geo.robinson=function(){return x(O)}).raw=O,D.invert=function(e,t){return[e/Math.cos(t),t]},(e.geo.sinusoidal=function(){return x(D)}).raw=D,z.invert=function(e,t){if(!(e*e+4*t*t>p*p+f)){var r=e,n=t,a=25;do{var i,o=Math.sin(r),l=Math.sin(r/2),s=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),d=Math.sin(2*n),h=c*c,g=u*u,v=l*l,m=1-g*s*s,x=m?y(u*s)*Math.sqrt(i=1/m):i=0,b=2*x*u*l-e,_=x*c-t,w=i*(g*v+x*u*s*h),k=i*(.5*o*d-2*x*c*l),M=.25*i*(d*l-x*c*g*o),T=i*(h*s+x*v*u),A=k*M-T*w;if(!A)break;var L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]}},(e.geo.aitoff=function(){return x(z)}).raw=z,R.invert=function(e,t){var r=e,n=t,a=25;do{var i,o=Math.cos(n),l=Math.sin(n),s=Math.sin(2*n),c=l*l,u=o*o,d=Math.sin(r),p=Math.cos(r/2),g=Math.sin(r/2),v=g*g,m=1-u*p*p,x=m?y(o*p)*Math.sqrt(i=1/m):i=0,b=.5*(2*x*o*g+r/h)-e,_=.5*(x*l+n)-t,w=.5*i*(u*v+x*o*p*c)+.5/h,k=i*(d*s/4-x*l*g),M=.125*i*(s*g-x*l*u*d),T=.5*i*(c*p+x*v*o)+.5,A=k*M-T*w,L=(_*k-b*T)/A,S=(b*M-_*w)/A;r-=L,n-=S}while((Math.abs(L)>f||Math.abs(S)>f)&&--a>0);return[r,n]},(e.geo.winkel3=function(){return x(R)}).raw=R}},{}],247:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",function(){n.select(this).style(s)}).on("zoom",function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})}).on("zoomend",function(){n.select(this).style(c),f(e,t,a)}),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t),m=2;function y(e){return t.invert(e)}function x(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=y(r)}).on("zoom",function(){if(d=n.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>m||Math.abs(n[1]-e[1])>m}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?y(d)&&(h=y(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=y(r=d),g=!0,e.render();var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})}).on("zoomend",function(){n.select(this).style(c),g&&f(e,t,x)}),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),d=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,m=(Math.atan2(d,u)-Math.atan2(c,a))*l,x=(Math.atan2(d,u)-Math.atan2(c,-a))*l,b=v(r[0],r[1],i,m),_=v(r[0],r[1],g,x);return b<=_?[i,m,r[2]]:[g,x,r[2]]}(k,r,S);isFinite(M[0])&&isFinite(M[1])&&isFinite(M[2])||(M=S),t.rotate(M),S=M}}else r=g(t,A=b);d.of(this,arguments)({type:"zoom"})}),T=d.of(this,arguments),p++||T({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(c),h.call(i,"zoom",null),r=d.of(this,arguments),--p||r({type:"zoomend"}),f(e,t,m)}).on("zoom.redraw",function(){e.render();var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),n.rebind(i,d,"on")}function g(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*o,r=e[1]*o,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function v(e,t,r,n){var a=m(r-e),i=m(n-t);return Math.sqrt(a*a+i*i)}function m(e){return(e%360+540)%360-180}function y(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function x(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",function(){m.sendDataToCloud(e)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},m.sendDataToCloud=function(e){e.emit("plotly_beforeexport");var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL,r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=m.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&D.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),m.linkSubplots(f,l,u,a),m.cleanPlot(f,l,u,a),a._zoomlayer&&!e._dragging&&a._zoomlayer.selectAll(".select-outline").remove(),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=m.layoutAttributes.width.min,p=m.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),m.sanitizeMargins(r)},m.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return m.doAutoMargin(e)}},m.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),A(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var y in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[y].l||{},b=h[y].b||{},_=x.val,w=x.size,k=b.val,M=b.size;for(var T in h){if(a(w)&&h[T].r){var L=h[T].r.val,S=h[T].r.size;if(L>_){var C=(w*L+(S-d)*_)/(L-_),P=(S*(1-_)+(w-d)*(1-L))/(L-_);C>=0&&P>=0&&d-(C+P)>0&&C+P>l+c&&(l=C,c=P)}}if(a(M)&&h[T].t){var O=h[T].t.val,D=h[T].t.size;if(O>k){var z=(M*O+(D-p)*k)/(O-k),R=(D*(1-k)+(M-p)*(1-O))/(O-k);z>=0&&R>=0&&p-(R+z)>0&&z+R>f+u&&(f=z,u=R)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&m.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var E=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&e._transitionData._interruptCallbacks.push(function(){return i.call("redraw",e)}),e._transitionData._interruptCallbacks.push(function(){e.emit("plotly_transitioninterrupted",[])});var o=0,l=0;function s(){return o++,function(){var t;l++,n||l!==o||(t=a,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return i.call("redraw",e)}).then(function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])}).then(t)))}}r.runFn(s),setTimeout(s())})}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then(function(){return e})}m.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},m.graphJson=function(e,t,r,n,a){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&m.supplyDefaults(e);var i=a?e._fullData:e.data,o=a?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function c(e){if("function"==typeof e)return null;if(s.isPlainObject(e)){var t,n,a={};for(t in e)if("function"!=typeof e[t]&&-1===["_","["].indexOf(t.charAt(0))){if("keepdata"===r){if("src"===t.substr(t.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=e[t+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))continue}else if("keepall"!==r&&"string"==typeof(n=e[t+"src"])&&n.indexOf(":")>0)continue;a[t]=c(e[t])}return a}return Array.isArray(e)?e.map(c):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var u={data:(i||[]).map(function(e){var r=c(e);return t&&delete r.fit,r})};return t||(u.layout=c(o)),e.framework&&e.framework.isPolar&&(u=e.framework.getConfig()),l&&(u.frames=c(l)),"object"===n?u:JSON.stringify(u)},m.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(P(c,d,p),a=0;a=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);T&&!M&&(S=0);var C=L.slice();A&&M&&(C[1]+=S);var P=d.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),d.angularAxis.ticksStep&&(P=(C[1]-C[0])/P);var O=d.angularAxis.ticksStep||(C[1]-C[0])/(P*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map(function(e,t){return parseFloat(e.toPrecision(12))}),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var E,I=e.select(".chart-group"),N={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(e,t){return" "+e+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){E=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map(function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend="undefined"==typeof e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r});o.Legend().config({data:p.map(function(e,t){return e.name||"Element"+t}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:E,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=E.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),E.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else E=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),d.title&&d.title.text){var q=e.select("g.title-group text").style(F).text(d.title.text),G=q.node().getBBox();q.attr({x:_[0]-G.width/2,y:_[1]-x-20})}var V=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var U=V.selectAll("circle.grid-circle").data(r.ticks(5));U.enter().append("circle").attr({class:"grid-circle"}).style(N),U.attr("r",r),U.exit().remove()}V.select("circle.outside-circle").attr({r:x}).style(N);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);V.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),V.selectAll(".domain").style(N),V.selectAll("g>text").text(function(e,t){return this.textContent+d.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),V.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(e,t){return t%(d.minorTicks+1)==0}).classed("minor",function(e,t){return!(t%(d.minorTicks+1)==0)}).style(N),J.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(F);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(e,t){return t%(d.minorTicks+1)!=0?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix}).style(F);d.angularAxis.rewriteTicks&&Q.text(function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)});var $=n.max(I.selectAll(".angular-tick text")[0].map(function(e,t){return e.getCTM().e+e.getBBox().width}));E.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach(function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter(function(e,r){return r==t}),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})});var re=n.nest().key(function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"}).entries(te),ne=[];re.forEach(function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map(function(e,t){return[e]})):ne.push(e.values)}),ne.forEach(function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map(function(e,t){return a(o[r].defaultConfig(),e)});o[r]().config(n)()})}var ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!M){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(e,t){oe.select("line").style({opacity:0})})}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ue.config({color:l}).text(u),ue.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ue.show()}).on("mouseout.tooltip",function(e,t){ue.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach(function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)}),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map(function(t,r){var n=t*Math.PI/180;return[t,e(n)]})},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach(function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if("undefined"==typeof e)return null;var r=[].concat(e);return n.range(t).map(function(e,t){return r[t]||r[0]})},o.util.fillArrays=function(e,t,r){return t.forEach(function(t,n){e[t]=o.util.ensureArray(e[t],r)}),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map(function(e,t){return n.sum(e)})},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter(function(e,t,r){return r.indexOf(e)==t})},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(e){return-d/2}).endAngle(function(e){return d/2}).innerRadius(function(e){return t.radialScale(s+(e[2]||0))}).outerRadius(function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,n,a){return r[e[a].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(e,t){return e});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()})}return i.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)}),this):e},i.getColorScale=function(){},n.rebind(i,t,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map(function(e,r){return[].concat(e).map(function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||"undefined"==typeof t.elements[r].visibleInLegend)}),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(e,t){return e.color}),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text(function(e,t){return o[t].name}),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map(function(e,r){var n=a({},e);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(e,r){o.util.translator.apply(null,e.concat(t))}),t||delete n.marker,t&&delete n.groupId,t?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map(function(e,t){return e.geometry}));r.data.forEach(function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)})}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(e,r){o.util.translator.apply(null,e.concat(t))}),t?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(e,t){u[c[s.indexOf(e.key)]]=e.value}),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":143,"../../../lib":168,d3:13}],257:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":49,"../../../lib":168,"./micropolar":256,"./undo_manager":258,d3:13}],258:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n?this:(t.splice(r+1,t.length-r),t.push(e),r=t.length-1,this)},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()});return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":49,"../components/drawing":70,"../constants/xmlns_namespaces":147,"../lib":168,d3:13}],270:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":48,"../../components/colorscale/attributes":56,"../../lib/extend":161,"../../plots/attributes":210,"../../plots/template_attributes":260,"../scattergeo/attributes":310}],271:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o,d.mockAxis),[e]}},{"../../lib":168,"../../plots/cartesian/axes":213,"./attributes":270}],275:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":243,"../heatmap/colorbar":279,"./attributes":270,"./calc":271,"./defaults":272,"./event_data":273,"./hover":274,"./plot":276,"./select":277,"./style":278}],276:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;pl&&T[v].gap;)v--;for(y=T[v].s,h=T.length-1;h>v;h--)T[h].s=y;for(;lA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],290:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&mU!=(N=D[P][1])>=U&&(R=D[P-1][0],E=D[P][0],N-I&&(z=R+(E-R)*(U-I)/(N-I),H=Math.min(H,z),q=Math.max(q,z)));H=Math.max(H,0),q=Math.min(q,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:H,x1:q,y0:U,y1:U,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":49,"../../components/fx":87,"../../lib":168,"../../registry":261,"./get_trace_color":293}],295:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":224,"./arrays_to_calcdata":282,"./attributes":283,"./calc":284,"./cross_trace_calc":288,"./cross_trace_defaults":289,"./defaults":290,"./format_labels":292,"./hover":294,"./marker_colorbar":301,"./plot":303,"./select":304,"./style":306,"./subtypes":307}],296:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":59,"../../components/colorscale/helpers":60,"../../lib":168}],297:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,M,T,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,P="log"===S.type,O=L._length,D=S._length,z=t.connectGaps,R=t.baseTolerance,E=t.shape,I="linear"===E,N=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),q=0;function G(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;P&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*O*(S._m>0?o:l)))),i*=1e3}if(s===a){if(P&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function V(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[q-1][0],a=r===H[q-1][1];if(!n||!a)if(q>1){var i=t===H[q-2][0],o=r===H[q-2][1];n&&(t===te||t===re)&&i?o?q--:H[q-1]=e:a&&(r===ne||r===ae)&&o?i?q--:H[q-1]=e:H[q++]=e}else H[q++]=e}function ue(e){H[q-1][0]!==e[0]&&H[q-1][1]!==e[1]&&ce([W,J]),ce(e),Q=null,W=J=0}function fe(e){if(T=e[0]/O,A=e[1]/D,Y=e[0]re?re:0,X=e[1]ae?ae:0,Y||X){if(q)if(Q){var t=K(Q,e);t.length>1&&(ue(t[0]),H[q++]=t[1])}else $=K(H[q-1],e)[0],H[q++]=$;else H[q++]=[Y||e[0],X||e[1]];var r=H[q-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(Q&&(W!==Y&&J!==X?ce(W&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,J||X]):W&&J&&ce([W,J])),ce([Y,X])):W-Y&&J-X&&ce([Y||W,X||J]),Q=e,W=Y,J=X}else Q&&ue(K(Q,e)[0]),H[q++]=e;var n,a,i,o}for("linear"===E||"spline"===E?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,e)U(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}Q&&ce([W||Q[0],J||Q[1]]),F.push(H.slice(0,q))}return F}},{"../../constants/numerical":146,"../../lib":168,"./constants":287}],298:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],299:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(t,a):0}}},{"fast-isnumeric":15}],301:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],302:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":49,"../../components/colorscale/defaults":59,"../../components/colorscale/helpers":60,"./subtypes":307}],303:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter(function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]}),g=Math.ceil(h.length/p),v=0;o.forEach(function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),M=o(k,"g","errorbars"),T=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var P=_.fill.charAt(_.fill.length-1);"x"!==P&&"y"!==P&&(P=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var O,D,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,N,F,j,B,H,q,G="",V="",U=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):I=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},U=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),q=_._polygons=new Array(U.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),s.singleLineStyle(f,a)}}}}}var Y=T.selectAll(".js-line").data(U);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),U.length?(S?(S.datum(f),j&&H&&(P?("y"===P?j[1]=H[1]=b.c2p(0,!0):"x"===P&&(j[0]=H[0]=x.c2p(0,!0)),y(S).attr("d","M"+H+"L"+j+"L"+G.substr(1)).call(s.singleFillStyle)):y(S).attr("d",G+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&G&&z?("tonext"===_.fill?y(C).attr("d",G+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",G+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=V,_._prevPolygons=q):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var k,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each(function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()}),o.selectAll("text").call(s.textPointStyle,u,e).each(function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:t,y:r})})}),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter(function(e){return!e.gap&&e.vis})}function Q(e){return e.filter(function(e){return e.vis})}function $(e){return e.filter(function(e){return!e.gap})}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,function(e){return e[0].trace.uid})).enter().append("g").attr("class",function(e){return"trace scatter trace"+e[0].trace.uid}).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each(function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each(function(e){i[e]=null}).remove(),u.order().each(function(e){i[e]=o(n.select(this),"path","js-fill")})})}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){a.selectAll("g.trace").each(function(r,n){p(e,n,t,r,v,this,i)})})):u.each(function(r,n){p(e,n,t,r,v,this,i)});h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":70,"../../lib":168,"../../lib/polygon":180,"../../registry":261,"./line_points":297,"./link_traces":299,"./subtypes":307,d3:13}],304:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":87,"../../constants/numerical":146,"../../lib":168,"../scatter/get_trace_color":293,"./attributes":310}],316:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":243,"../scatter/marker_colorbar":301,"../scatter/style":306,"./attributes":310,"./calc":311,"./defaults":312,"./event_data":313,"./format_labels":314,"./hover":315,"./plot":317,"./select":318,"./style":319}],317:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;r